Arithmetic Coding and Date, Calculation

Page 1 of 1

1 Replies - 6685 Views - Last Post: 05 April 2010 - 09:00 PMRate Topic: //<![CDATA[ rating = new ipb.rating( 'topic_rate_', { url: 'http://www.dreamincode.net/forums/index.php?app=forums&module=ajax&section=topics&do=rateTopic&t=166341&amp;s=3b7c8f104c1115979957ea7b2dbca6a6&md5check=' + ipb.vars['secure_hash'], cur_rating: 0, rated: 0, allow_rate: 0, multi_rate: 1, show_rate_text: true } ); //]]>

#1 yukirou

Reputation: 0
• Posts: 5
• Joined: 18-March 10

Arithmetic Coding and Date, Calculation

Posted 05 April 2010 - 07:01 PM

Hye there.... I am in the process in implementing a Customer Billing Tracking System in VB.Net 2008 and using SQL Server 2005 as the database.How ever there are a few calculations and formulas i have to write (of coz, since it is a customer billing tracking system...)

there scenario is here :
-Client will have contract with the company (who belongs this system).
-Client have a START_DATE & END_DATE for the project (period)
-The contract period will be count in monthly NOT year; example a contract period is 2 years=counted as 24 months.
-Client have two method to pay the contract; Whether MONTHLY or QUARTERLY

System will:
** Calculate the contract period in month.A month equal with 30 days.
- Once the admin insert the percentage of payment paid by client, system will display the percentage and amount left.
-For MONTHLY payment method the formula is (CONTRACT_PERIOD/CONTRACT_AMOUNT)
Which will show how much the client should pay per-month
-For QUARTERLY payment method the formula is [(CONTRACT_PERIOD/CONTRACT_AMOUNT)*3] which will show how much the client should pay per-quarterly

=================================================================================
***the main problem now is HOW TO WRITE THE CODE & FORMULA to make the system calculate the days /years in period to month?(convert) like example : "contract of client XYZ started from 1 Jan. 2008 and end on 12 march. 2009" which is equal to 406 days (forgive me if i'm wrong)or 13.5 months.
(Admin will insert the start_date & end_date= I use Date Time Picker in VB.Net.)

***How to make the system calculate the remain balance of unpaid payment : example XYZ have a contract which costed \$500k and already paid 20% (the percentage will be insert by Admin; ouh.. this is another problem, when admin will put the percentage OR exact amount already paid=example XYZ already paid \$50k, how many percent left?)>> System should automatically shows the amount in \$

**should i write the formula/arithmetic inside the VB code or should i write in the SQL query or BOTH? and how is the formula and syntax should i use? please help me.. and if possible could anyone write a little program/codes in here...

for ur information i already finished the design of all forms and database's table (but without data and any formula)..so i just need to know what arithmetic and code should use and where is the line in VB and SQL.

sorry coz i wrote to much things in here but i have to explain it deeply so everyone will understand my problems/questions

=================================================================================

This post has been edited by yukirou: 05 April 2010 - 07:05 PM

Is This A Good Question/Topic? 0

Replies To: Arithmetic Coding and Date, Calculation

#2 PsychoCoder

Reputation: 1646
• Posts: 19,853
• Joined: 26-July 07

Re: Arithmetic Coding and Date, Calculation

Posted 05 April 2010 - 09:00 PM

Sorry but we can not give you the entire code to solve your problem. We are here to assist in solving problems with code you have written, with any error messages you are getting or what isn't working the way that you expect it to, we would be more than happy to help you with those problems. If there is a topic that you don't understand we would be more than happy to help you with that as well. Make sure to post any code with in code tags like below.

Be sure to visit our tutorial and snippet areas or read the FAQS at the top of the forums. Also, take a moment to read the rules about posting topics.