lundi 26 octobre 2015

RelationShip between CustPackingSlipTrans and CustInvoiceTrans

X++  Query

CustInvoicePackingSlipQuantityMatch custInvoicePackingSlipQuantityMatch;
    CustInvoiceTrans custInvoiceTrans;
    CustPackingSlipTrans custPackingSlipTrans;
    CustPackingSlipJour custPackingSlipJour;
 
    select firstOnly custPackingSlipJour
    join custPackingSlipTrans
    where custPackingSlipJour.PackingSlipId==custPackingSlipTrans.PackingSlipId
    join custInvoicePackingSlipQuantityMatch
    where custInvoicePackingSlipQuantityMatch.PackingSlipSourceDocumentLine==custPackingSlipTrans.SourceDocumentLine
    join custInvoiceTrans
    where custInvoicePackingSlipQuantityMatch.InvoiceSourceDocumentLine==custInvoiceTrans.SourceDocumentLine
    ;


SQL Query

select invTrans.INVOICEID,invTrans.QTY ,slipTrans.PACKINGSLIPID, slipTrans.QTY,slipTrans.NAME  from
CustInvoicePackingSlipQuantityMatch match
join CustInvoiceTrans invTrans on invTrans.SOURCEDOCUMENTLINE=match.INVOICESOURCEDOCUMENTLINE
join CustPackingSlipTrans slipTrans  on slipTrans.SOURCEDOCUMENTLINE = match.PACKINGSLIPSOURCEDOCUMENTLINE

Find LogisticsElectronicAddress X++ Code



select firstonly  logisticsElectronicAddress
join dirPartyLocation
join vendTable
where logisticsElectronicAddress.Location == dirPartyLocation.Location
&& vendTable.Party == dirPartyLocation.Party
//&& logisticsElectronicAddress.IsPrimary == NoYes::Yes
&& logisticsElectronicAddress.Type == LogisticsElectronicAddressMethodType::Telex
&& vendTable.AccountNum == vendTable.AccountNum ;