SCRIPT SAMPLE: Credit Limits Set By Head Office
  • COBS Tech Support
    Posts: 674
    Joined: Fri Sep 09, 2005 8:23 am

    SCRIPT SAMPLE: Credit Limits Set By Head Office

    by COBS Tech Support » Thu Jun 21, 2018 4:34 pm

    Here is a sample script that changes the credit limit checking behaviour of the system to use the credit limit of a head office for associated branch customers.

    Code: Select all

    * R-CLIMIT.MAC COBS (example script)
    * Centralise Head Office Credit Control

    * If a branch, locate head office
    If .NOT. IsEmpty(Custrec->Cusacc)
       Custrec->(Find(Custrec->Cusacc))
       TotalDue := Custrec->FPay0 + Custrec->Pay30 + Custrec->Pay60 + Custrec->Pay90
    Endif

    If TotalDue + Amount > Custrec->Cuscredit
       Echo("Sorry, the credit limit of account " + Alltrim(Custrec->Cuscode) + " has been exceeded by " + NTrim((TotalDue + Amount) - Custrec->Cuscredit, 12, 2) + ";;Credit limit: " + NTrim(Custrec->Cuscredit, 12, 2))
       Return FALSE
    Endif

    Return TRUE

Who is online

Users browsing this forum: No registered users and 0 guests