View Full Version : Create start date


renenger
03-22-2007, 03:14 PM
I created a module to generate the correct date to begin manufacturing. There are two sets of criteria. If the job's prefinish is a certain code then manufacturing takes 7 days. If the job's door style is a certain code then manufacturing takes 5 to 6 days. Otherwise the date range is 4. Prefinish takes precedence over door style. I have units that have the special prefinish and one of the door styles listed then it gets the door style days instead of 7 days. Any ideas?


Function CreateWOSDDate(ByVal PreFin As String, ByVal DrStyle As String, ByVal DelDate As Date) As Date


Dim intNumDays As Integer


Select Case PreFin

Case "BR17", "BR28", "WH06", "BR06", "BR11", "WH17", "BR00", "BR22"
intNumDays = 7
Case Else
intNumDays = 4
End Select

Select Case DrStyle

Case "DCREag", "DCRHWK", "DCRFAL", "RP-9", "RP-22", "RP-23", "Eagle", "H/E", "F/E", "FALCON", "AR756", "HAWK", "RP22", "RP23", "RP9", "EAG", "HWK", "FALCN", "SHAKER", "NEVADA"
intNumDays = 6
Case "PAC"
intNumDays = 5
Case Else
intNumDays = 4

End Select



CreateWOSDDate = MinusWorkdays(DelDate, intNumDays)


End Function

RuralGuy
03-22-2007, 03:23 PM
Can you describe what the type of PreFinish does to the normal DoorStyle schedule?

renenger
03-22-2007, 03:27 PM
An order looks something like this:


Job Phase Unit Dr Style PreFin Species DelDate WOSD
GDS 1 29 FALCN BR28 SWM 4/4/07 (MOD generated)


This unit has a FALCN door which would take 6 days to build. However, it also has the prefin of BR28 which takes 7 days to build. The WOSD should be 3/26 not 3/27.

When the module runs the order has a WOSD of 3/27.

RuralGuy
03-22-2007, 03:43 PM
Try this piece of code.
Function CreateWOSDDate(ByVal PreFin As String, ByVal DrStyle As String, ByVal DelDate As Date) As Date

Dim intNumDays As Integer

Select Case PreFin

Case "BR17", "BR28", "WH06", "BR06", "BR11", "WH17", "BR00", "BR22"
intNumDays = 7
Case Else
intNumDays = 4
End Select

Select Case DrStyle

Case "DCREag", "DCRHWK", "DCRFAL", "RP-9", "RP-22", "RP-23", "Eagle", "H/E", "F/E", "FALCON", "AR756", "HAWK", "RP22", "RP23", "RP9", "EAG", "HWK", "FALCN", "SHAKER", "NEVADA"
If intNumDays = 4 Then
intNumDays = 6
End If
Case "PAC"
If intNumDays = 4 Then
intNumDays = 5
End If
Case Else
'-- Nothing need be done

End Select

CreateWOSDDate = MinusWorkdays(DelDate, intNumDays)

End Function

renenger
03-23-2007, 10:10 AM
That worked great!!!!

Thank you so much!!! :D

RuralGuy
03-23-2007, 10:16 AM
Glad I could help.