xTuple.com xTupleU Blog & News Customer Support

Post an Invoices

Hi everyone

I have created invoices from our transactions from Oracle. Therefore there is no PO or Sales Order for these new invoices.

When I try to post these invoices I get the error

Error Posting Invoice ERROR: No sales account was resolvable for the current non-misc invoice item. [xtuple: postInvoice, -11, 119895]
CONTEXT: PL/pgSQL function postinvoice(integer,integer,integer,boolean) line 212 at RAISE
(P0001)

I am confused with the No sales account , does this mean I have to set the column invchead_misc_accnt_id

or create a sales order for these transactions and then create the invoice.

Thank you

Hi,

Make sure you have an entry in the Sales Assignment table:

System->Setup

Module: Sales

Accounting Mapping->Sales Assignment

It could be related to different item fields but usually most likely Product Category.

Bernard Le Jour
AS Plus Informatique Inc.

I don’t think that changing invchead_misc_accnt_id will solve your problem

looking at the database function

    --  Cache the amount due for this line
    _amount := _regularInvcItemData.extprice;

    IF _amount != 0 THEN

      --  Credit the Sales Account for the invcitem item
      IF _regularInvcItemData.invcitem_rev_accnt_id IS NOT NULL THEN
        _regularSalesAccntId := getPrjAccntId(_contextData.invchead_prj_id,
                                              _regularInvcItemData.invcitem_rev_accnt_id);
      ELSEIF _regularInvcItemData.itemsite_id IS NULL THEN
        SELECT getPrjAccntId(_contextData.invchead_prj_id, salesaccnt_sales_accnt_id)
        INTO _regularSalesAccntId
        FROM salesaccnt
        WHERE salesaccnt_id = findSalesAccnt(pId => _regularInvcItemData.invcitem_item_id,
                                             pIdType => 'I',
                                             pCustid => _contextData.invchead_cust_id,
                                             pSaletypeid => _contextData.invchead_saletype_id,
                                             pShipzoneid => _contextData.invchead_shipzone_id);
      ELSE
        SELECT getPrjAccntId(_contextData.invchead_prj_id, salesaccnt_sales_accnt_id)
        INTO _regularSalesAccntId
        FROM salesaccnt
        WHERE salesaccnt_id = findSalesAccnt( pId => _regularInvcItemData.itemsite_id,
                                              pIdType => 'IS',
                                              pCustid => _contextData.invchead_cust_id,
                                              pSaletypeid => _contextData.invchead_saletype_id,
                                              pShipzoneid => _contextData.invchead_shipzone_id);
      END IF;

      --  If the Sales Account Assignment was not found then punt
      IF _regularSalesAccntId IS NULL OR _regularSalesAccntId < 0 THEN

        RAISE EXCEPTION
          'No sales account was resolvable for the current non-misc invoice item. [xtuple: postInvoice, -11, %]',
          _regularInvcItemData.invcitem_id;

I think you need to set the ‘invcitem_rev_accnt_id’
But I’m not sure what that account would be.

I would suggest opening a sandbox and creating one in xTuple interface. Then looking at the account ID’s paying specific attention to “invcitem_rev_accnt_id” and “invchead_prj_id”

You are selling specific items from inventory. But you are not telling it where to put the credit the sales too. That is the general reason for the error. It would mess with the books.

Thank you Caleb,

I overlooked that column in my import.

I will correct it

Bob

That worked Caleb, thank you