view faktur pada Everest ERP

Membuat View pada MS SQL Server 2000, ERP Everest system, untuk membuat faktur dan Report Form nya menggunakan Cristal Report. Tabel yang digunakan INVOICES,ADDRESS,CUST,X_INVOIC,ITEMS,PERSONAL dan CUSTOMER_CLASS, status pada INVOICES merupakan kode Faktur / transaksi faktur.

pada system Everest terdapat custom report yang merupakan kumpulan report yang di create dari Cristal report
yang didaftarkan pada menu Custom, di initialisasikan

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[VIEW_FAKTUR]’) and OBJECTPROPERTY(id, N’IsView’) = 1)
drop view [dbo].[VIEW_FAKTUR]
GO

SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO

CREATE VIEW dbo.VIEW_FAKTUR
AS
SELECT A.ORDER_NO, A.ORDER_DATE, A.REFERENCE, A.CUSTCHAR1 AS NOPAJAK, A.CUSTLOG1 AS CTK, A.DATE_FLD, A.PO, A.CUST_CODE, A.TRANRATE, B.ACCT_NAME AS OUTLET,
B.STREET_ADDRESS AS ALAMAT, B.CITY AS KECAMATAN, B.STATE AS KOTA, C.TAX_ID, D.ITEM_CODE, D.[SEQUENCE], E.DESCRIPT,D.QTY_SHIP,
D.ITEM_PRICE, D.DISCOUNT_V AS DISCVAL, (D.QTY_SHIP*D.ITEM_PRICE) AS TOTALGROSS, C.PAY_TERMS, A.TERMS, A.SALES_REP, F.PFIRST AS SALESNAME,
C.CUSTCLASS, G.CLASS_DESC, YEAR(A.ORDER_DATE) AS TAHUN, MONTH(A.ORDER_DATE) AS BULAN

FROM dbo.INVOICES A INNER JOIN
dbo.ADDRESS B ON A.BILL_CODE = B.ADDR_CODE INNER JOIN
dbo.CUST C ON A.CUST_CODE = C.CUST_CODE INNER JOIN
dbo.X_INVOIC D ON A.ORDER_NO = D.ORDER_NO AND A.STATUS = D.STATUS INNER JOIN
dbo.ITEMS E ON D.ITEM_CODE = E.ITEMNO INNER JOIN
dbo.PERSONAL F ON A.SALES_REP = F.IDNO INNER JOIN
dbo.CUSTOMER_CLASS G ON C.CUSTCLASS = G.CLASS_CODE
WHERE A.STATUS = 9

GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO

This entry was posted in Programming. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s