Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

AR terms due on delivery of goods 1

Status
Not open for further replies.

johnhugh

Technical User
Mar 24, 2010
702
SG
Hi,

In Accpac 5.6, can I somehow set a terms code like 50% now and 50% on delivery of goods?
Don't think I can but worth asking anyway.
 
You can do a payment schedule with 50% now and 50% later (say 60 days) but there is no option for "on delivery" because how would AR know when something is delivered?
 
Thanks ettienne. Makes sense what you're saying.
 
I've done customizations allowing the user to change the due date of a payment, even a split payment. As Ettienne indicated - if you can get confirmation of a delivery date then a couple of macros/queries would allow you to make that happen.
 
Thanks DjangMan.

Is there a trick for changing the percentage due?
I can't seem to chaneg it from 100% but need 2 lines with 50% each.
 
Ok, I found the Multiple Payment Schedule Option.
 
The only trick now is changing those dates after you've posted the invoice - if you need to do that. You might not need to depending on your process.
 
Thanks. So in what table woul dI be changing the invoice?
I've done something similiar for chaning the PO arrival date but I reckon it might be a bit more complicated with AR invoices?
 
Off the top of my head AROBS and ARIBS. Perhaps AROBL for the final due date, too.
 
Hi,

I've now played around a bit with this and came up with the macro below to change the due date on A/R invoices.

Could someone please let me know whether this is correct as I'm not really experienced in Accpac macros?
It seems to run fine and it shows the updaetd due date when I run the A/R ageing.
I tried updating it in ARIBH as well but I can't even loop through and find my invoice number in there for some reason.
Would anyone know why?

Code:
Dim mDBLinkCmpRW As AccpacCOMAPI.AccpacDBLink
Dim ARbatch As AccpacCOMAPI.AccpacView
Dim ARheader As AccpacCOMAPI.AccpacView
Dim ARdetail1 As AccpacCOMAPI.AccpacView
Dim ARdetail2 As AccpacCOMAPI.AccpacView
Dim ARdetail3 As AccpacCOMAPI.AccpacView
Dim ARdetail4 As AccpacCOMAPI.AccpacView

Sub MainSub()
'
On Error GoTo ACCPACErrorHandler

'open DB
Set mDBLinkCmpRW = OpenDBLink(DBLINK_COMPANY, DBLINK_FLG_READWRITE)

'Open views
mDBLinkCmpRW.OpenView "AR0031", ARbatch
mDBLinkCmpRW.OpenView "AR0036", ARheader    'AROBL
'mDBLinkCmpRW.OpenView "AR0032", ARheader    'ARIBH
mDBLinkCmpRW.OpenView "AR0033", ARdetail1
mDBLinkCmpRW.OpenView "AR0034", ARdetail2
mDBLinkCmpRW.OpenView "AR0402", ARdetail3
mDBLinkCmpRW.OpenView "AR0401", ARdetail4

'Compose views
ARbatch.Compose Array(ARheader)
ARheader.Compose Array(ARbatch, ARdetail1, ARdetail2, ARdetail3, Nothing)
ARdetail1.Compose Array(ARheader, ARbatch, ARdetail4)
ARdetail2.Compose Array(ARheader)
ARdetail3.Compose Array(ARheader)
ARdetail4.Compose Array(ARdetail1)

'get AR header
ARheader.GoTop
Do
    If ARheader.Fields("IDINVC") = "IN000689" Then
        Exit Do
    End If
Loop While ARheader.GoNext

'update invoice
If ARheader.Fields("IDINVC") = "IN000689" Then
    Test = ARheader.Fields("DATEDUE").Value
    ARheader.Fields("DATEDUE").Value = DateSerial(2011, 8, 13)     ' Due Date
    
    ARheader.Process
    ARheader.Update
End If

Set mDBLinkCmpRW = Nothing

Exit Sub

 
arheader.order = 1
arheader.browse "IDCUST = """ & mycust & """ AND IDINVC = """ & myinvoice & """",true
If arheader.fetch then
...
end if
 
Thanks Tuba. I'll try that code.

Any idea on how to update ARIBH as I don't seem to be able to loop through it?
 
That's what I posted. You don't loop, you just .Fetch the record.

However, if the batch has been posted, don't update it, there's no point. Just update AROBL.
 
Hi,

I've done the below macro to update due dates in A/R invoices and it works well - but only if I log on as Admin.

I logged on as another user and have given him full permissions in all the modules - including A/R.
When the user runs the macro he gets the error message below.
The macro fails at ARheader.Update in my code.

"Attempt to perform Record Update without security authorization."

What permission am I missing here?

Code:
Private Sub cmdUpdate_Click()
Dim intDay, intMonth, intYear As Integer

Set mDBLinkCmpRW = OpenDBLink(DBLINK_COMPANY, DBLINK_FLG_READWRITE)

'Open views
mDBLinkCmpRW.OpenView "AR0031", ARbatch
mDBLinkCmpRW.OpenView "AR0036", ARheader    'AROBL
mDBLinkCmpRW.OpenView "AR0033", ARdetail1
mDBLinkCmpRW.OpenView "AR0034", ARdetail2
mDBLinkCmpRW.OpenView "AR0402", ARdetail3
mDBLinkCmpRW.OpenView "AR0401", ARdetail4

'Compose views
ARbatch.Compose Array(ARheader)
ARheader.Compose Array(ARbatch, ARdetail1, ARdetail2, ARdetail3, Nothing)
ARdetail1.Compose Array(ARheader, ARbatch, ARdetail4)
ARdetail2.Compose Array(ARheader)
ARdetail3.Compose Array(ARheader)
ARdetail4.Compose Array(ARdetail1)

On Error GoTo ACCPACErrorHandler
error = False

DTPicker1.Format = dtpCustom
DTPicker1.CustomFormat = "dd/MM/yyyy"
        
intDay = Format(DTPicker1.Value, "dd")
intMonth = Format(DTPicker1.Value, "MM")
intYear = Format(DTPicker1.Value, "yyyy")
      
If strInvNumber <> "" Then
        
ARheader.Order = 1
ARheader.Browse "IDCUST = """ & strIDCust & """ AND IDINVC = """ & strInvNumber & """", True

If ARheader.Fetch Then
    ARheader.Fields("DATEDUE").Value = DateSerial(intYear, intMonth, intDay)     ' Due Date
       
    ARheader.Process
    ARheader.Update  [red] It fails here [/red]
End If

End If

frmInvoice.Hide

Exit Sub
 
Since you're breaking business logic to do this, either login as ADMIN, or do the update with ADO or the CS0120 view.
 
Thanks tuba.
I take it there is no way to change the due date without breaking the business logic?
 
To expand:

The ADMIN user can do things with Views directly that other user IDs can't do. That doesn't mean you can change whatever you want through the UI but when you're updating views via code you seem to have greater power to change field data. I've never really tested to see just what the limitations of using the ADMIN user to make changes are - perhaps there are none - but I know that you can do things that you wouldn't expect to be able to do.

Using the CS0120 view allows you to hit the database directly - no business logic is invoked.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top