Stored Procedures [dbo].[MssWebGetOrderThirdPartyServices]
Properties
PropertyValue
ANSI Nulls OnYes
Quoted Identifier OnYes
Parameters
NameData TypeMax Length (Bytes)
@inOrderPriKeyint4
Permissions
TypeActionOwning Principal
GrantExecuteMssExec
SQL Script
CREATE procedure [dbo].[MssWebGetOrderThirdPartyServices]
    @inOrderPriKey int
as
begin
    set nocount on

    select
        Id                        = OrderThirdParty.OrdThirdPartyPriKey,
        -------------------------------------------------------------------
        Amount                    = OrderThirdParty.Amount,
        PONumber                = OrderThirdParty.PONumber,
        InvoiceNumber            = OrderThirdParty.InvoiceNumber,
        [Description]            = OrderThirdParty.[Description],
        [Date]                    = OrderThirdParty.[Date],
        InvoiceReceivedDate        = OrderThirdParty.InvoiceReceivedDate,
        InvoiceApprovedDate        = OrderThirdParty.InvoiceApprovedDate,
        -------------------------------------------------------------------
        VendorId                = Vendor.VendorID,
        VendorName                = Vendor.[Name],
        -------------------------------------------------------------------
        AccountingVendorId        = Vendor.AccountingVendorId,
        AccountingVendorNumber    = Vendor.VendorID,
        AccountingVendorName    = Vendor.[Name],
        AccountingVendorCity    = Vendor.City,
        AccountingVendorState    = Vendor.[State],
        case when Vendor.AccountingVendorId is not null
            then
                cast(
                    case Vendor.Hold
                        when 'On Hold' then 1
                        else 0
                    end as bit
                )
             else null
         end
         as AccountingVendorOnHold

    from OrderThirdPartysVendor_Synonym OrderThirdParty

    left outer join Vendor_Synonym Vendor on
        Vendor.VendorJoinField = OrderThirdParty.VendorJoinField
    
    where OrderThirdParty.OrdPriKey = @inOrderPriKey
end
GO
GRANT EXECUTE ON  [dbo].[MssWebGetOrderThirdPartyServices] TO [MssExec]
GO
Uses