Purchase: Save PI Error - Column “ReferCAJEIsPayment” does not belong to table APInvoice

From AutoCount Resource Center
Jump to navigation Jump to search

Question : When I try to save Purchase Invoice, the system prompts me an error – Column “ReferCAJEIsPayment” does not belong to table APInvoice . How can I solve this problem?

Refercajeispayment1.jpg


Possible Reason :

This is due to some columns missing from the AP Invoice or other related tables in the system. This would happen when the update of AutoCount version is not done properly.


Solution :

Log out AutoCount, and go to SQL Management Studio to run the query provided on the affected database.

1. Click on the Windows Start button & type to search for SQL Management Studio.

2. Select your server name with instance (Example: JS-PC\A2006).

3. Select “SQL Server Authentication”.

4. Type login as sa.

5. Type your SQL Server instance password.

6. Click on Connect.

Refercajeispayment2.png


7. Click on New Query.

8. Select the database name that having the mentioned issue.

9. Copy and paste the following query provided below into the blank space.

10. Click on Execute to run the query.

Refercajeispayment3.png


SQL queries to be copied and pasted onto SQL Management Studio is:

if not exists (SELECT * FROM dbo.syscolumns WHERE id = object_id('APInvoice') AND name = 'ReferCAJEIsPayment')

ALTER TABLE [dbo].[APInvoice] ADD [ReferCAJEIsPayment] [d_Boolean] NULL
GO

if not exists (SELECT * FROM dbo.syscolumns WHERE id = object_id('APInvoice') AND name = 'ReferCAJEDocKey')
ALTER TABLE [dbo].[APInvoice] ADD [ReferCAJEDocKey] [bigint] NULL
GO

if not exists (SELECT * FROM dbo.syscolumns WHERE id = object_id('APInvoice') AND name = 'ReferCAJEDocNo')
ALTER TABLE [dbo].[APInvoice] ADD [ReferCAJEDocNo] [d_DocNo] NULL
GO

if not exists (SELECT * FROM dbo.syscolumns WHERE id = object_id('APPayment') AND name = 'ReferCAJEDocKey')
ALTER TABLE [dbo].[APPayment] ADD [ReferCAJEDocKey] [bigint] NULL
GO

if not exists (SELECT * FROM dbo.syscolumns WHERE id = object_id('APPayment') AND name = 'ReferCAJEDocNo')
ALTER TABLE [dbo].[APPayment] ADD [ReferCAJEDocNo] [d_DocNo] NULL
GO

UPDATE APInvoice Set ReferCAJEIsPayment = 'T' Where ReferCAJEDocKey IS NULL


After running this query, you may then create new Purchase Invoice.

For the installation of SQL Management Studio, refer to How to install Microsoft SQL Management Studio


By : Jae Sen 180814, Lay Swan 180823, P180823



Go to menu

IconAcc20.PNG AutoCount Accounting 2.0


IconAcc188.PNG AutoCount Accounting 1.8 / 1.9
Wiki-Payroll.png AutoCount Payroll
Wiki-POS.PNG AutoCount POS
Wiki-AOTG.PNG AutoCount On The Go
Wiki-Accounting-Plugin.png AutoCount Accounting Plug-In Documentations