Created
August 23, 2012 09:44
-
-
Save mattiaswolff/3434801 to your computer and use it in GitHub Desktop.
Mediusflow: Get invoice information on all invoices on one project
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
declare @strAccount nvarchar(20) | |
declare @strCompanyId nvarchar(20) | |
set @strAccount = '' | |
set @strCompanyId = '' | |
SELECT InvoiceNumber, | |
VerificationIdentity, | |
SupplierName, | |
ps.SupplierId, | |
InvoiceDate, | |
DueDate, | |
iha.Debit as 'Debit', | |
iha.credit as 'Kredit', | |
TotalAmount, | |
Currency | |
FROM INVOICE_HEAD ih | |
INNER JOIN PRO_SUPPLIER ps ON (ps.ID = ih.SupplierId) | |
INNER JOIN INVOICE_HEAD_ACCOUNTING iha ON (iha.InvoiceId = ih.ID) | |
WHERE iha.AccountProjectId = | |
(select id from accounting where value = @strAccount and ACCOUNTING_TYPEID in | |
(select ID from ACCOUNTING_TYPE where COMPANYID = | |
(select ID from company where COMPANY_ID = @strCompanyId))) | |
ORDER BY VerificationIdentity |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment