|
-
Sep 30th, 2005, 09:20 PM
#1
Thread Starter
Fanatic Member
inventory sms system
hi, how to make an very simple inventory
this is the screenshots

now if the Amt Loaded receive P26.00 in the income will appear P4.00
then schem
Amt Loaded / Income
P26.00 / P4.00
P52.00 / P8.00
P100.00 / P15.00
P200.00 / P0.00
P300.00 / P10.00
P500.00 / P0.00
P1000.00 / P0.00
i want only to compute the INCOME
daily/monthly/yearly
the code for listview is
VB Code:
Sub LoadListView(strPath As String, SettingsList As ListView)
Dim s1 As String
SettingsList.ListItems.Clear
Dim fso As New FileSystemObject, tso As TextStream
Set tso = fso.OpenTextFile(strPath)
Do While Not tso.AtEndOfStream
s1 = tso.ReadLine
SettingsList.ListItems.Add , , s1
Loop
tso.Close
End Sub
VB Code:
Dim i As Long
Dim strData() As String
Call LoadListView(App.Path & "\ReadELoadMessages", lstRawData)
DoEvents
lstRawData.ListItems.Remove 1
lstRawData.ListItems.Remove 1
DoEvents
If lstRawData.ListItems.Count >= 10 Then
For i = 10 To lstRawData.ListItems.Count Step 11
If InStr(lstRawData.ListItems.Item(i).Text, "Unable to process transaction") = 0 Then
If InStr(lstRawData.ListItems.Item(i).Text, ":") <> 0 Then
strData = Split(lstRawData.ListItems.Item(i), ":")
lstData.ListItems.Add , , strData(0)
lstData.ListItems.Item(lstData.ListItems.Count).ListSubItems.Add , , Mid$(strData(1), InStr(strData(1), " to ") + 4, InStrRev(strData(1), ".") - InStr(strData(1), " to ") - 4)
lstData.ListItems.Item(lstData.ListItems.Count).ListSubItems.Add , , Mid$(strData(1), InStr(strData(1), "(") + 1, InStrRev(strData(1), ")") - InStr(strData(1), "(") - 1)
lstData.ListItems.Item(lstData.ListItems.Count).ListSubItems.Add , , strData(3)
lstData.ListItems.Item(lstData.ListItems.Count).ListSubItems.Add , , Left$(strData(2), InStrRev(strData(2), ".") - 1)
End If
End If
Next i
End If
Last edited by nokmaster; Sep 30th, 2005 at 09:28 PM.
-
Sep 30th, 2005, 09:40 PM
#2
-
Sep 30th, 2005, 09:43 PM
#3
Re: inventory sms system
dglienna:
 Originally Posted by nokmaster
hi, how to make an very simple inventory
So go and teach him...
-
Sep 30th, 2005, 09:44 PM
#4
Thread Starter
Fanatic Member
Re: inventory sms system
@dglienna
the question is how to compute and then if the Amt Loaded Receive P26.00 the Income Should P4.00 and so on... u will see the schem...
i want to compute the DAILY/MONTHLY/YEARLY Income
and of course to have an database...
thanks a lot...
-
Sep 30th, 2005, 09:44 PM
#5
Re: inventory sms system
1st... you should try to distinguish even a bit between storing data, processing data and displaying data or a 3 tier design approach ESPECIALLY with accounting related apps, makes modifications/updates later on easier. Doing computations in the GUI should be a last resort.
With a good DB design and knowledge on SQL query this task will become more manageable. You can easily extract the daily/monthly/yearly info from one or several tables and easily create reports with existing objects/OCXs/etc.
-
Sep 30th, 2005, 09:49 PM
#6
Thread Starter
Fanatic Member
Re: inventory sms system
@leinad31
thanks for replying...
could write some sample?
thanks...
-
Sep 30th, 2005, 09:54 PM
#7
Re: inventory sms system
You should also use numbers for calculations. P4.00 doesn't make sense to a computer as a currency amount. You could use a select case statement to calculate 'income'
VB Code:
select case AmtLoaded
case 0 to 26
profit = 4
case 27 to 52
profilt = 8
case 53 to 100
profit = 15
case 100-200
profit = 0
case 200 to 300
profit = 10
end select
except that I don't understand your breakdown. at first it looked like you were using ranges, except that they started going down...
-
Sep 30th, 2005, 10:04 PM
#8
Thread Starter
Fanatic Member
Re: inventory sms system
@dglienna
i got an error with
it says not Variable Not Defined
-
Sep 30th, 2005, 10:08 PM
#9
Re: inventory sms system
 Originally Posted by nokmaster
@leinad31
thanks for replying...
could write some sample?
thanks...
The topic is too broad to cover with one thread ^^
Read up on it and ask more specific questions. Start with SQL queries just the basics, you'll then get a good idea for the design of the DB tables in line with your knowledge of SQL (one inventory data table, SQl for the different views/reports). GUI module should be just that, transferring/formatting data from a DB or an inbetween data store for display to the user.
Avoid data bound controls or anything similar... its a nightmare to update. Any changes to the DB struct would require a code update all the way to the GUI just to avoid run time errors. Any changes/errors in computation are hard to track down since its sandwhiched in GUI and data layer code.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|