BOI - How to insert an adjustment record in AP Invoice Data Entry

SOLVED

Hi

I am using BOI to insert records in AP Invoice Data Entry. I am able to insert the header and lines record
successfully. Can anybody please help me understand how can I insert an adjustment record? Because while inserting an adjustment
record I have to use the same invoice number inserted before and when I try to insert the same invoice number, I get an exception which says
"Invoice number is in use by another user". Is there any header field that I have to set while inserting an adjustment record?
The header fields that I am inserting are
APDivisionNo
VendorNo
BatchNo
InvoiceNo
InvoiceDate
InvoiceDueDate
HoldPayment
Comment
Adjustment
RecurringInvoice
SeparateCheck
InvoiceAmt
NetInvoiceAmt
TermsCode

Thank you in advance.

  • 0

    mm09,

    Are you trying to create an invoice and its adjustment in the same data entry batch?  You cannot do that.  You can only create adjustment for an invoice that has been updated.  An adjustment invoice is like a normal invoice except that you set Adjustment$ to Y.  When you set the InvoiceNo$, you will get a warning (-1).  You can continue to SetKey and the rest of the fields.

  • 0 in reply to Natasha Chang

    Thank you Natasha. I appreciate your help.

    So I will have to add one more header record with same invoice number but Adjustment$ set to Y and a line item with the adjustment amount. Should the amount on line match with the invoice amount on header?

    For Example, I have added an invoice record where Adjustment$ is set to N with invoice amt 1200.

    Now I want to add an adjustment record with adjustment amount -500. I create a header record with same invoice number where Adjustment$ is set to Y.

    What should be the Invoice Amt on (adjustment)header and (adjustment)line in this case?

    Thank you again for your help.

  • 0 in reply to mm09

    Both header and line amounts need to be -500.

  • 0 in reply to Natasha Chang

    Natasha,

    When I try to add the header and line record with the same invoice number and Adjustment$ set to Y and with the same header and line amount, I get an error which says "The invoice is out of balance. Do you want to delete the Invoice?". Where am I going wrong?

  • 0 in reply to mm09

    Did you set InvoiceAmt in the header and DistributionAmt in the detail?  There are several amount fields.

    Here is my really quick test in PVX syntax:

    o = NEW("AP_Invoice_bus", %sys_ss)

    r = o'SetKeyValue("APDivisionNo$", "01")

    r = o'SetKeyValue("VendorNo$", "AIRWAY")

    r = o'SetKeyValue("InvoiceNo$", "1053190")

    r = o'SetKey()

    r = o'SetValue("Adjustment$", "Y")

    r = o'SetValue("InvoiceAmt", -10)

    r = o'AddLine()

    r = o'Lines'SetValue("AccountKey$", "100000000")

    r = o'Lines'SetValue("DistributionAmt", -10)

    r = o'Lines'Write()

    r = o'Write()

     

  • 0 in reply to Natasha Chang

    Yes. I am setting the same amount in  InvoiceAmt field in Header and in DistributionAmt field in line.

  • 0 in reply to mm09

    See my example above.  Is your script similar to mine?

  • 0 in reply to Natasha Chang

    Natasha,

    My script looks the same like yours except that I am also setting the other header fields in the adjustment invoice and I am setting the same value in InvoiceAmt and in DistributionAmt field.

    r = o'SetKeyValue("APDivisionNo$", "00")

    r = o'SetKeyValue("VendorNo$","HD")

    r = o'SetKeyValue("InvoiceNo$","1000124")

    r = o'SetKey()

    r = o'SetValue("InvoiceDate$", "04/30/2014")

    r = o'SetValue("InvoiceDueDate$", "04/30/2014")

    r = o'SetValue("HoldPayment$", "N")

    r = o'SetValue("Comment$", "IMPORTED")

    r = o'SetValue("Adjustment$", "Y")

    r = o'SetValue("RecurringInvoice$", "N")

    r = o'SetValue("SeparateCheck$", "N")

    r = o'SetValue("InvoiceAmt","-200.00")

    r = o'SetValue("TermsCode$", "00")

    r = o'Lines'AddLine()

    r = o'Lines'SetValue("AccountKey$","220100000")

    r = o'Lines'SetValue("DistributionAmt","-200.00")

    r = o'Lines'Write()

    r = o'Write()

    Thanks you.

  • 0 in reply to mm09

    I forgot to mention something. Before setting APDivisionNo, I am selecting the batch number. It is the same batch number which has the invoice with same invoice number and where Adjustment$ is set to N.(It is the invoice without the adjustment amount)

    r = o'Selectbatch("01113")

  • 0 in reply to mm09

    The InvoiceAmt and DistributionAmt fields are numeric fields.  Remove the quotes from around the values when doing the SetValue() of a numeric field.

    The two lines from your example should be:

    r = o'SetValue("InvoiceAmt",-200.00)

    and

    r = o'Lines'SetValue("DistributionAmt",-200.00)