Thursday, January 21, 2016

Cusotmer Invoice Agianst Packingslip in ax 2012

    CustInvoiceTrans                    custInvoiceTrans;
    CustInvoicePackingSlipQuantityMatch custInvoicePackingSlipQuantityMatch;
    CustPackingSlipTrans                custPackingSlipTrans;
    Notes                               packingslipId;
    ;
    while  select PackingSlipId from custPackingSlipTrans Group by PackingSlipId
            exists join custInvoicePackingSlipQuantityMatch
                where custInvoicePackingSlipQuantityMatch.PackingSlipSourceDocumentLine == custPackingSlipTrans.SourceDocumentLine
            exists join custInvoiceTrans
                where custInvoiceTrans.SourceDocumentLine == custInvoicePackingSlipQuantityMatch.InvoiceSourceDocumentLIne &&
                    custInvoiceTrans.SalesId == this.SalesId &&
                    custInvoiceTrans.InvoiceId == this.InvoiceId &&
                    custInvoiceTrans.InvoiceDate == this.InvoiceDate &&
                    custInvoiceTrans.NumberSequenceGroup == this.numberSequenceGroup
    {
        packingslipId += strFmt("%1,",custPackingSlipTrans.PackingSlipId);
    }
    return packingslipId;

No comments:

Post a Comment

Search hierarchy for a match (TableALLGroup) X++

  Table1 ppt;  select firstonly ppt  order ItemCode, ItemRelation, AccountCode, AccountRelation where      (ppt.ItemCode == TableGroupAll::T...