Hello guys,
I created an invoicing module for one of our database in this office, what this does is if the Reporting Period is for Q the price is $45.00 per statement(job we do),and if a checkbox named 24HourRush is checked, the Q price would be $67.50 or if the checkbox named 1-3DayRush is checked, the Q price would be $56.25. We also have a Reporting Period of YE, the price for that is $50.00, if 24HourRush is checked the price would change to $75.00 and if 1-3DayRush is checked the price would change to $62.50.
The module I have for this is below:
This is correctly pulling out the price for invoicing. However, things got complicated though that if the number of statements (jobs) reached 10,000 in one year (Jan-Dec) the price for Reporting Period Q will be reduced to $42.50, and if the 24HourRush for Reporting Period Q is checked the price will be $63.75 and if the 1-3DayRush is checked the price will be $53.13.
The field type to count to see if we already reached 10,000 statements completed within the year is Signed_Off (this is a date data type) we put the date here to mark it as complete and have been returned back to the client. So if the number of Signed_Off is 10,000 between January-December then the price will change to the above mentioned prices.
Any help is greatly appreciated.
Thanks
I created an invoicing module for one of our database in this office, what this does is if the Reporting Period is for Q the price is $45.00 per statement(job we do),and if a checkbox named 24HourRush is checked, the Q price would be $67.50 or if the checkbox named 1-3DayRush is checked, the Q price would be $56.25. We also have a Reporting Period of YE, the price for that is $50.00, if 24HourRush is checked the price would change to $75.00 and if 1-3DayRush is checked the price would change to $62.50.
The module I have for this is below:
Code:
Public Function GetAmount(O_ITV As Variant, Rush24 As Boolean, Rush36 As Boolean, RptPrd As String) As Currency
Dim curO_ITV As Currency
Dim curRush24 As Currency
Dim curRush36 As Currency
Dim curRptPrdQYE As Currency
Dim curDefault As Currency
Dim curRush24Q As Currency
Dim CurRush36Q As Currency
Dim curRptPrdQ As Currency
curO_ITV = 12
curRush24 = 75
curRush36 = 62.5
curRush24Q = 67.5
CurRush36Q = 56.25
curRptPrdQYE = 50
curRptPrdQ = 45
curDefault = 0
Dim curAmt As Currency
Select Case True
Case IsNull(O_ITV) = False
curAmt = curO_ITV
Case RptPrd Like "*YE*" And Rush24 = True
curAmt = curRush24
Case RprPrd Like "*YE*" And Rush36 = True
curAmt = curRush36
Case RptPrd Like "*Q*" And Rush24 = True
curAmt = curRush24Q
Case RptPrd Like "*Q*" And Rush36 = True
curAmt = CurRush36Q
Case RptPrd Like "*YE*" And Rush36 = True
curAmt = curRush36
Case RptPrd Like "*YE*"
curAmt = curRptPrdQYE
Case RptPrd Like "*Q*"
curAmt = curRptPrdQ
Case Else
curAmt = curDefault
End Select
GetAmount = curAmt
End Function
This is correctly pulling out the price for invoicing. However, things got complicated though that if the number of statements (jobs) reached 10,000 in one year (Jan-Dec) the price for Reporting Period Q will be reduced to $42.50, and if the 24HourRush for Reporting Period Q is checked the price will be $63.75 and if the 1-3DayRush is checked the price will be $53.13.
The field type to count to see if we already reached 10,000 statements completed within the year is Signed_Off (this is a date data type) we put the date here to mark it as complete and have been returned back to the client. So if the number of Signed_Off is 10,000 between January-December then the price will change to the above mentioned prices.
Any help is greatly appreciated.
Thanks