× Discuss on Template programming, jBASE programming, Enquiries, No-File enquiry, Enquiry routines, Version, Version routines, Menus, Abbriviations, Creating local reference fields, Fast path enquiries, Creating charts and graphs, Generating Reports, Deal slips, Straight through processing, Multi Company and Multi Book setup, Tabbed screens, Composite Screens, T24 API, etc...

Routine to calculate number of days in arrears,

  • Winfred_Lubega
  • Topic Author
  • Offline
  • Senior Member
  • Senior Member
  • Me
More
4 years 10 months ago #20587 by Winfred_Lubega
Routine to calculate number of days in arrears, was created by Winfred_Lubega
Please help with a routine for calculating number of days in arrears and number of missed payments

Please Log in or Create an account to join the conversation.

More
4 years 7 months ago #20965 by madhulatha
Replied by madhulatha on topic Routine to calculate number of days in arrears,
CDT: Description Calculates forward or previous date from a start date using the number of days. Arguments (REGION, DATE, DAYS)
Incoming: REGION Region code
DATE Start date, YYYYMMDD
DAYS The number of days forward in the format + or -, the number of days, working or calendar
eg : +99C, -6W, +66W+3C

Returned: DATE The calculated date
ETEXT Error message if unsuccessful

Example: Y.DATE='20130225', DAYS='+2C' ,REGION =''

CALL CDT(REGION,Y.DATE,DAYS)

Please Log in or Create an account to join the conversation.

  • VK
  • VK's Avatar
  • Offline
  • Platinum Member
  • Platinum Member
  • TAFC|R19/R21
More
4 years 7 months ago #20967 by VK
Hi
I afraid that's not what the topic starter wants... He needs to translate the business requirements "output number of days in arrears and number of missed payments" into the technical solution... Before calculating the difference its necessary to understand where to get the date for calculation...

Unfortunately I can't be of help here.

Please Log in or Create an account to join the conversation.

  • concern
  • concern's Avatar
  • Offline
  • Premium Member
  • Premium Member
  • R18 | TAFC | ORACLE
More
2 months 4 weeks ago #23372 by concern
Did you get the routine name? I am also looking for it.

Please Log in or Create an account to join the conversation.

  • silvergem
  • Offline
  • Elite Member
  • Elite Member
  • TAFC|R12/R13
More
2 months 3 weeks ago #23384 by silvergem
Replied by silvergem on topic Routine to calculate number of days in arrears,
The core function for days calculation is CDT and CDD, but getting the missed payment is another thing

Please Log in or Create an account to join the conversation.

More
2 weeks 22 hours ago #23451 by chanthachantha
Replied by chanthachantha on topic Routine to calculate number of days in arrears,
Example:
Start date: 20210909
End date: 20250909

How to calculate number of day include with working and holiday?

Please Log in or Create an account to join the conversation.

  • silvergem
  • Offline
  • Elite Member
  • Elite Member
  • TAFC|R12/R13
More
1 week 6 days ago - 1 week 6 days ago #23452 by silvergem
Replied by silvergem on topic Routine to calculate number of days in arrears,
You may refer for dates routines on this one  t24 subroutines: t24 subroutine . You can use CDD which return DATES difference for both working and calendar days. You can subtract the calendar to working days to get the actual difference. to calculate the holiday, you can count all holiday on HOLIDAY table
PROGRAM BUH.DAYS
    $INSERT ../T24_BP I_COMMON
    $INSERT ../T24_BP I_EQUATE
    $INSERT ../T24_BP I_F.DATES
    CALL LOAD.COMPANY ('BNK')
    Y.DATE.S = "20210909"
    Y.DATE.E = "20250909"
    DAYS = "W"
    GOSUB CHECK.DIFF
    DAYS.WORKING = DAYS    
    
    DAYS = "C"
    GOSUB CHECK.DIFF
    DAYS.CALENDAR = DAYS
    CRT "WORKING DAYS  " : DAYS.WORKING
    CRT "CALENDAR DAYS " : DAYS.CALENDAR
    CRT "DIFFERENCE    " : DAYS.CALENDAR - DAYS.WORKING
RETURN
CHECK.DIFF:
    REGION = ""
    CALL CDD (REGION, Y.DATE.S, Y.DATE.E, DAYS)
RETURN
END
    
Last edit: 1 week 6 days ago by silvergem.

Please Log in or Create an account to join the conversation.

Time to create page: 0.284 seconds