Page 1 of 1

Creditor Allocation confusion

PostPosted: Fri Sep 04, 2009 3:31 pm
by pricerc
Hi again.

(In 6.5.13) I have the following snippet of code for allocating a payment to a purchase invoice:
Code:
Code: Select all
Set creditor = GetCreditor(creditor, creditorID)
    allocID = ""
   
    Set newAllocation = creditor.Allocations.Add( _
        allocID, _
        rs("DebitTransID"), _
        newItem.CRTransID, _
        newItem.SupplierTransAmount, _
        newItem.HomeTransAmount, _
        newItem.HomeTransAmount, _
        newItem.CurrencyRateUsed, _
        newItem.CurrencyRateUsed, _
        False, _
        False, _
        newItem.ReceiptDate)

    creditor.SaveRecord


where newItem is a JiwaCRBatchTX.clsCRBatchTranLine, and rs is an ADODB.RecordSet querying the Purchase Invoice.

It seems to work ok, except that when I look at the main creditor transaction screen, the transactions don't appear allocated. However when I click either transaction's 'allocate' button, it looks like it's already allocated, and it won't let me change anything.

Have I missed a step ?

/Ryan

Re: Creditor Allocation confusion

PostPosted: Thu Nov 12, 2009 2:31 pm
by Mike.Sheen
pricerc wrote:It seems to work ok, except that when I look at the main creditor transaction screen, the transactions don't appear allocated. However when I click either transaction's 'allocate' button, it looks like it's already allocated, and it won't let me change anything.

Have I missed a step ?

/Ryan


Hard to say - You're using the creditor maintenance business logic to do the allocation, right ? ie: the GetCreditor method returns an instance of JiwaCreditors.clsCreditor ?

Re: Creditor Allocation confusion

PostPosted: Thu Nov 12, 2009 4:41 pm
by pricerc
Hard to say - You're using the creditor maintenance business logic to do the allocation, right ? ie: the GetCreditor method returns an instance of JiwaCreditors.clsCreditor ?


Yes.

Re: Creditor Allocation confusion

PostPosted: Fri Nov 13, 2009 9:58 am
by Mike.Sheen
pricerc wrote:Yes.


Well, that's pretty much how we do the allocation ourselves, so I'm at a loss as to why that doesn't work. I'll need a complete sample which will work on a database I have access to (eg: Demo data) to troubleshoot this some more.

Mike

Re: Creditor Allocation confusion

PostPosted: Fri Nov 13, 2009 11:09 am
by pricerc
Thanks Mike.

makes me feel a *bit* better.

I'm on a different project at the moment, so will have to go through it in detail when I can next fire up my 6.5.13 VM. Probably next week some time.

/Ryan

Re: Creditor Allocation confusion

PostPosted: Sat Nov 14, 2009 6:54 pm
by Mike.Sheen
pricerc wrote:Thanks Mike.

makes me feel a *bit* better.

I'm on a different project at the moment, so will have to go through it in detail when I can next fire up my 6.5.13 VM. Probably next week some time.

/Ryan


Ok, in the meantime I'll whip up a sample project that does what you're trying to achieve against demo data - I'll post it here, and perhaps that will assist.

One question : Do you want this to be in VS.NET (if so, which version - 2005 or 2008) or VB6 ?

Re: Creditor Allocation confusion

PostPosted: Sun Nov 15, 2009 11:24 am
by pricerc
Mike,

my code is all in breakouts (I'm trying to avoid having to load extra DLLs) - so VB6, I suppose.

/Ryan