a
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Xml.Serialization;
|
||||
@@ -9,208 +10,63 @@ namespace HUIWEI.Lexmark.sftp.SDK.Domain
|
||||
|
||||
// 注意: 生成的代码可能至少需要 .NET Framework 4.5 或 .NET Core/Standard 2.0。
|
||||
/// <remarks/>
|
||||
[System.SerializableAttribute()]
|
||||
[System.ComponentModel.DesignerCategoryAttribute("code")]
|
||||
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
|
||||
[Serializable()]
|
||||
[DesignerCategory("code")]
|
||||
[XmlType(AnonymousType = true)]
|
||||
[XmlRoot(elementName: "Invoice", Namespace = "", IsNullable = false)]
|
||||
public partial class Invoice
|
||||
{
|
||||
|
||||
private InvoiceHeader headerField;
|
||||
|
||||
private InvoiceLineItem[] lineItemField;
|
||||
|
||||
private InvoiceSummary summaryField;
|
||||
|
||||
/// <remarks/>
|
||||
public InvoiceHeader Header
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.headerField;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.headerField = value;
|
||||
}
|
||||
}
|
||||
public InvoiceHeader Header { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
[System.Xml.Serialization.XmlElementAttribute("LineItem")]
|
||||
public InvoiceLineItem[] LineItem
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.lineItemField;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.lineItemField = value;
|
||||
}
|
||||
}
|
||||
public InvoiceLineItem[] LineItem { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
public InvoiceSummary Summary
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.summaryField;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.summaryField = value;
|
||||
}
|
||||
}
|
||||
public InvoiceSummary Summary { get; set; }
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[System.SerializableAttribute()]
|
||||
[System.ComponentModel.DesignerCategoryAttribute("code")]
|
||||
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
|
||||
[Serializable()]
|
||||
[DesignerCategory("code")]
|
||||
[XmlType(AnonymousType = true)]
|
||||
public partial class InvoiceHeader
|
||||
{
|
||||
private string supplierField;
|
||||
|
||||
private string buyerField;
|
||||
|
||||
private string invoiceTypeField;
|
||||
|
||||
|
||||
private string currencyField;
|
||||
|
||||
private string paymentTermsField;
|
||||
|
||||
private string incotermsField;
|
||||
|
||||
private string customerNumberField;
|
||||
|
||||
private object headerField1Field;
|
||||
|
||||
private object headerField2Field;
|
||||
|
||||
|
||||
/// <remarks/>
|
||||
public string Supplier
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.supplierField;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.supplierField = value;
|
||||
}
|
||||
}
|
||||
public string Supplier { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
public string Buyer
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.buyerField;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.buyerField = value;
|
||||
}
|
||||
}
|
||||
public string Buyer { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
public string InvoiceType
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.invoiceTypeField;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.invoiceTypeField = value;
|
||||
}
|
||||
}
|
||||
public string InvoiceType { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
public uint InvoiceDate { get; set; }
|
||||
public string InvoiceDate { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
public uint InvoiceNumber { get; set; }
|
||||
public string InvoiceNumber { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
public string Currency
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.currencyField;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.currencyField = value;
|
||||
}
|
||||
}
|
||||
public string Currency { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
public string PaymentTerms
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.paymentTermsField;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.paymentTermsField = value;
|
||||
}
|
||||
}
|
||||
public string PaymentTerms { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
public string Incoterms
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.incotermsField;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.incotermsField = value;
|
||||
}
|
||||
}
|
||||
public string Incoterms { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
public string CustomerNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.customerNumberField;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.customerNumberField = value;
|
||||
}
|
||||
}
|
||||
public string CustomerNumber { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
public object HeaderField1
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.headerField1Field;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.headerField1Field = value;
|
||||
}
|
||||
}
|
||||
public string HeaderField1 { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
public object HeaderField2
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.headerField2Field;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.headerField2Field = value;
|
||||
}
|
||||
}
|
||||
public string HeaderField2 { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
public InvoiceHeaderVendor Vendor { get; set; }
|
||||
@@ -220,13 +76,13 @@ namespace HUIWEI.Lexmark.sftp.SDK.Domain
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[System.SerializableAttribute()]
|
||||
[System.ComponentModel.DesignerCategoryAttribute("code")]
|
||||
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
|
||||
[Serializable()]
|
||||
[DesignerCategory("code")]
|
||||
[XmlType(AnonymousType = true)]
|
||||
public partial class InvoiceHeaderVendor
|
||||
{
|
||||
/// <remarks/>
|
||||
public object PartyId { get; set; }
|
||||
public string PartyId { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
public string Name { get; set; }
|
||||
@@ -235,25 +91,25 @@ namespace HUIWEI.Lexmark.sftp.SDK.Domain
|
||||
public string AddressLine1 { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
public object AddressLine2 { get; set; }
|
||||
public string AddressLine2 { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
public string City { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
public object State { get; set; }
|
||||
public string State { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
public object PostalCode { get; set; }
|
||||
public string PostalCode { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
public object Country { get; set; }
|
||||
public string Country { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
public object ContactName { get; set; }
|
||||
public string ContactName { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
public object Email { get; set; }
|
||||
public string Email { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
public string Telephone { get; set; }
|
||||
@@ -263,497 +119,125 @@ namespace HUIWEI.Lexmark.sftp.SDK.Domain
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[System.SerializableAttribute()]
|
||||
[System.ComponentModel.DesignerCategoryAttribute("code")]
|
||||
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
|
||||
[Serializable()]
|
||||
[DesignerCategory("code")]
|
||||
[XmlType(AnonymousType = true)]
|
||||
public partial class InvoiceHeaderBillTo
|
||||
{
|
||||
|
||||
private string partyIdField;
|
||||
|
||||
private string nameField;
|
||||
|
||||
private string addressLine1Field;
|
||||
|
||||
private string addressLine2Field;
|
||||
|
||||
private string cityField;
|
||||
|
||||
private object stateField;
|
||||
|
||||
private ushort postalCodeField;
|
||||
|
||||
private string countryField;
|
||||
|
||||
private object contactNameField;
|
||||
|
||||
private object emailField;
|
||||
|
||||
private object telephoneField;
|
||||
|
||||
private object faxField;
|
||||
/// <remarks/>
|
||||
public string PartyId { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
public string PartyId
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.partyIdField;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.partyIdField = value;
|
||||
}
|
||||
}
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
public string Name
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.nameField;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.nameField = value;
|
||||
}
|
||||
}
|
||||
public string AddressLine1 { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
public string AddressLine1
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.addressLine1Field;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.addressLine1Field = value;
|
||||
}
|
||||
}
|
||||
public string AddressLine2 { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
public string AddressLine2
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.addressLine2Field;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.addressLine2Field = value;
|
||||
}
|
||||
}
|
||||
public string City { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
public string City
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.cityField;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.cityField = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public object State
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.stateField;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.stateField = value;
|
||||
}
|
||||
}
|
||||
public string State { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
public string PostalCode { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
public string Country
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.countryField;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.countryField = value;
|
||||
}
|
||||
}
|
||||
public string Country { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
public object ContactName
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.contactNameField;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.contactNameField = value;
|
||||
}
|
||||
}
|
||||
public string ContactName { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
public object Email
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.emailField;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.emailField = value;
|
||||
}
|
||||
}
|
||||
public string Email { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
public object Telephone
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.telephoneField;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.telephoneField = value;
|
||||
}
|
||||
}
|
||||
public string Telephone { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
public object Fax
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.faxField;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.faxField = value;
|
||||
}
|
||||
}
|
||||
public string Fax { get; set; }
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[System.SerializableAttribute()]
|
||||
[System.ComponentModel.DesignerCategoryAttribute("code")]
|
||||
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
|
||||
[Serializable()]
|
||||
[DesignerCategory("code")]
|
||||
[XmlType(AnonymousType = true)]
|
||||
public partial class InvoiceLineItem
|
||||
{
|
||||
|
||||
private byte item_Line_NumberField;
|
||||
|
||||
private ulong lXK_PONumberField;
|
||||
|
||||
private object lXK_PODateField;
|
||||
|
||||
private ulong vendorSONumberField;
|
||||
|
||||
private uint deliveryNoteNumberField;
|
||||
|
||||
private object billOfLadingNumberField;
|
||||
|
||||
private object shipmentDateField;
|
||||
|
||||
private string lEX_PNField;
|
||||
|
||||
private ushort quantityField;
|
||||
|
||||
private string unit_Of_MeasureField;
|
||||
|
||||
private string lXK_DescriptionField;
|
||||
|
||||
private decimal unitPriceField;
|
||||
|
||||
private decimal totalAmountField;
|
||||
|
||||
private object lineItemField1Field;
|
||||
|
||||
private object lineItemField2Field;
|
||||
/// <remarks/>
|
||||
public string Item_Line_Number { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
public byte Item_Line_Number
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.item_Line_NumberField;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.item_Line_NumberField = value;
|
||||
}
|
||||
}
|
||||
public string LXK_PONumber { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
public ulong LXK_PONumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.lXK_PONumberField;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.lXK_PONumberField = value;
|
||||
}
|
||||
}
|
||||
public string LXK_PODate { get; set; }
|
||||
/// <remarks/>
|
||||
public string VendorSONumber { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
public object LXK_PODate
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.lXK_PODateField;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.lXK_PODateField = value;
|
||||
}
|
||||
}
|
||||
public string DeliveryNoteNumber { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
public ulong VendorSONumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.vendorSONumberField;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.vendorSONumberField = value;
|
||||
}
|
||||
}
|
||||
public string BillOfLadingNumber { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
public uint DeliveryNoteNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.deliveryNoteNumberField;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.deliveryNoteNumberField = value;
|
||||
}
|
||||
}
|
||||
public string ShipmentDate { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
public object BillOfLadingNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.billOfLadingNumberField;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.billOfLadingNumberField = value;
|
||||
}
|
||||
}
|
||||
public string LEX_PN { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
public object ShipmentDate
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.shipmentDateField;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.shipmentDateField = value;
|
||||
}
|
||||
}
|
||||
public int Quantity { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
public string LEX_PN
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.lEX_PNField;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.lEX_PNField = value;
|
||||
}
|
||||
}
|
||||
public string Unit_Of_Measure { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
public ushort Quantity
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.quantityField;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.quantityField = value;
|
||||
}
|
||||
}
|
||||
public string LXK_Description { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
public string Unit_Of_Measure
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.unit_Of_MeasureField;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.unit_Of_MeasureField = value;
|
||||
}
|
||||
}
|
||||
public decimal UnitPrice { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
public string LXK_Description
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.lXK_DescriptionField;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.lXK_DescriptionField = value;
|
||||
}
|
||||
}
|
||||
public decimal TotalAmount { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
public decimal UnitPrice
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.unitPriceField;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.unitPriceField = value;
|
||||
}
|
||||
}
|
||||
public string LineItemField1 { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
public decimal TotalAmount
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.totalAmountField;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.totalAmountField = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public object LineItemField1
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.lineItemField1Field;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.lineItemField1Field = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public object LineItemField2
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.lineItemField2Field;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.lineItemField2Field = value;
|
||||
}
|
||||
}
|
||||
public string LineItemField2 { get; set; }
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[System.SerializableAttribute()]
|
||||
[System.ComponentModel.DesignerCategoryAttribute("code")]
|
||||
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
[Serializable()]
|
||||
[DesignerCategory("code")]
|
||||
[XmlType(AnonymousType = true)]
|
||||
public partial class InvoiceSummary
|
||||
{
|
||||
|
||||
private decimal shippingChargeField;
|
||||
|
||||
private decimal otherChargesField;
|
||||
|
||||
private decimal taxAmountField;
|
||||
|
||||
private decimal taxableAmountField;
|
||||
|
||||
private decimal totalGrossAmountField;
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public decimal ShippingCharge { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
public decimal ShippingCharge
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.shippingChargeField;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.shippingChargeField = value;
|
||||
}
|
||||
}
|
||||
public decimal OtherCharges { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
public decimal OtherCharges
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.otherChargesField;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.otherChargesField = value;
|
||||
}
|
||||
}
|
||||
public decimal TaxAmount { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
public decimal TaxAmount
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.taxAmountField;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.taxAmountField = value;
|
||||
}
|
||||
}
|
||||
public decimal TaxableAmount { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
public decimal TaxableAmount
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.taxableAmountField;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.taxableAmountField = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public decimal TotalGrossAmount
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.totalGrossAmountField;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.totalGrossAmountField = value;
|
||||
}
|
||||
}
|
||||
public decimal TotalGrossAmount { get; set; }
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -6,28 +6,55 @@ BEGIN
|
||||
|
||||
;WITH #LEX_MaterialNumber AS(
|
||||
SELECT b.billno
|
||||
--FROM (SELECT CAST('<v>'+REPLACE('41X6129,50X1203,B225X00',',','</v><v>')+'</v>' AS xml) billno) a
|
||||
FROM (SELECT CAST('<v>'+REPLACE(@materialNumber,',','</v><v>')+'</v>' AS xml) billno) a
|
||||
OUTER APPLY (SELECT T.C.value('.','varchar(50)') billno FROM a.billno.nodes('/v') AS T(C)) b
|
||||
)
|
||||
SELECT *
|
||||
,#<23><><EFBFBD>ݴ<EFBFBD><DDB4><EFBFBD> AS (
|
||||
SELECT t1.*
|
||||
FROM #LEX_MaterialNumber tt
|
||||
CROSS APPLY (
|
||||
SELECT t0.FMATERIALID,t0.FNUMBER,t0_l.FNAME
|
||||
--,tt.billno 'FSPECIFICATION'
|
||||
,t0_l.FSPECIFICATION
|
||||
,t1.FNUMBER Unit
|
||||
,CONCAT('FF',ISNULL(t0ap.FAUXPROPERTYID,0)) AS 'FAUXPROPERTYID'
|
||||
,CONVERT(int,t0ap.FISENABLE) FISENABLE
|
||||
,tt.billno LexNumber
|
||||
FROM T_BD_MATERIAL t0
|
||||
INNER JOIN T_BD_MATERIAL_L t0_l on t0_l.FMATERIALID = t0.FMATERIALID
|
||||
AND t0_l.FLOCALEID = 2052
|
||||
INNER JOIN T_BD_MATERIALSALE t0s on t0s.FMATERIALID = t0.FMATERIALID
|
||||
INNER JOIN T_BD_UNIT t1 on t1.FUNITID = t0s.FSALEUNITID
|
||||
LEFT JOIN t_BD_MaterialAuxPty t0ap on t0.FMATERIALID = t0ap.FMATERIALID
|
||||
WHERE 1 = 1 AND t0.FUSEORGID = @ORGID --944852
|
||||
AND (CHARINDEX(tt.billno,t0_l.FNAME) > 0)
|
||||
AND t0.FDOCUMENTSTATUS = 'C'
|
||||
AND t0.FFORBIDSTATUS = 'A'
|
||||
) t0
|
||||
PIVOT
|
||||
(
|
||||
SUM(t0.FISENABLE) FOR
|
||||
t0.FAUXPROPERTYID IN (FF100001,FF100002)
|
||||
) t1
|
||||
)
|
||||
SELECT *
|
||||
FROM (
|
||||
SELECT t0.FMATERIALID,t0.FNUMBER,t0_l.FNAME,t0_l.FSPECIFICATION,t1.FNUMBER Unit
|
||||
,CONCAT('FF',ISNULL(t0ap.FAUXPROPERTYID,0)) AS 'FAUXPROPERTYID'
|
||||
,CONVERT(int,t0ap.FISENABLE) FISENABLE
|
||||
FROM T_BD_MATERIAL t0
|
||||
INNER JOIN T_BD_MATERIAL_L t0_l on t0_l.FMATERIALID = t0.FMATERIALID
|
||||
AND t0_l.FLOCALEID = 2052
|
||||
INNER JOIN T_BD_MATERIALSALE t0s on t0s.FMATERIALID = t0.FMATERIALID
|
||||
INNER JOIN T_BD_UNIT t1 on t1.FUNITID = t0s.FSALEUNITID
|
||||
INNER JOIN #LEX_MaterialNumber tx on CHARINDEX(tx.billno,t0_l.FNAME) > 0
|
||||
LEFT JOIN t_BD_MaterialAuxPty t0ap on t0.FMATERIALID = t0ap.FMATERIALID
|
||||
WHERE 1=1
|
||||
AND t0.FUSEORGID = @ORGID
|
||||
SELECT t0.LexNumber,COUNT(1) ls
|
||||
FROM #<23><><EFBFBD>ݴ<EFBFBD><DDB4><EFBFBD> t0
|
||||
GROUP BY t0.LexNumber
|
||||
) t0
|
||||
PIVOT
|
||||
(
|
||||
SUM(t0.FISENABLE) FOR
|
||||
t0.FAUXPROPERTYID IN (FF100001,FF100002)
|
||||
CROSS APPLY (
|
||||
SELECT t1.FMATERIALID,t1.FNUMBER,t1.FNAME,t1.LexNumber 'FSPECIFICATION'
|
||||
,t1.Unit,t1.FF100001,t1.FF100002
|
||||
FROM #<23><><EFBFBD>ݴ<EFBFBD><DDB4><EFBFBD> t1
|
||||
WHERE t1.LexNumber = t0.LexNumber AND t0.ls = 1
|
||||
UNION ALL
|
||||
SELECT t1.FMATERIALID,t1.FNUMBER,t1.FNAME,t1.FSPECIFICATION
|
||||
,t1.Unit,t1.FF100001,t1.FF100002
|
||||
FROM #<23><><EFBFBD>ݴ<EFBFBD><DDB4><EFBFBD> t1
|
||||
WHERE t1.LexNumber = t0.LexNumber AND t0.ls > 1
|
||||
AND (t0.LexNumber = t1.FSPECIFICATION)
|
||||
) t1
|
||||
|
||||
END
|
||||
Reference in New Issue
Block a user