CAPITAL Office Business Software
CAPITAL Support Forum
FAQSearchMembersGroupsRegisterProfilePM'sLogin/Out
SCRIPT SAMPLE: Credit Limits Set By Head Office

 
Post new topic   Reply to topic    CAPITAL Office Business Software Forum Index -> Scripting & Customisation
View previous topic :: View next topic  
Author Message
COBS Tech Support



Joined: 09 Sep 2005
Posts: 643

PostPosted: Thu Jun 21, 2018 4:34 pm    Post subject: SCRIPT SAMPLE: Credit Limits Set By Head Office Reply with quote

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:

* 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
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    CAPITAL Office Business Software Forum Index -> Scripting & Customisation All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

phpBB Template by Vereor
Protected by Anti-Spam ACP