NJC__Documentation::DB

dbo.vw_ms_manual_invoce_group_supplier

Description

Properties

Name Value
ANSI Nulls ON

True

Quoted Identifier ON

True

Encrypted

False

Execute As
Null on Null Input

False

Schema Bound

False

Assembly

Parameters

Name Data Type Length Description
@ms_manual_invoice_type_id int 4

SQL Script

SET QUOTED_IDENTIFIER, ANSI_NULLS ON
GO

CREATE FUNCTION dbo.vw_ms_manual_invoce_group_supplier (@ms_manual_invoice_type_id int)  
RETURNS TABLE  
AS  
RETURN   
(   
 SELECT        mapping_supplier_customer_id AS supplier_customer_id
 , COUNT(*) AS invoice_total,
 sum(case when r_s=0 then 1 else 0 end) as  invoice_ready
 FROM            vw_ms_manual_invoce
 where         (NOT (mapping_supplier_customer_id = - 1 OR
       mapping_supplier_customer_id IS NULL) ) and used =0
 AND ms_manual_invoice_type_id=@ms_manual_invoice_type_id
 GROUP BY mapping_supplier_customer_id
);  
 
GO