ATNYLASalesInvoiceDP_Extension | YourSite

ATNYLASalesInvoiceDP_Extension


SELECT TOP 1 *
FROM tmpTaxWorkTrans
WHERE SourceRecId = @RecId
  AND SourceTableId = @TableId
  AND TaxCode = 'IdtTireFee';



display AmountCur displaySourceRegulateAmountCur()
{
    TaxWorkTrans tmpTaxWorkTrans;
    SalesLine salesLine;
    
    select firstOnly * from tmpTaxWorkTrans
        where tmpTaxWorkTrans.SourceRecId == this.RecId &&
              tmpTaxWorkTrans.SourceTableId == this.TableId &&
              tmpTaxWorkTrans.TaxCode == 'IdtTireFee';
    
    if (tmpTaxWorkTrans)
    {
        return tmpTaxWorkTrans.SourceRegulateAmountCur;
    }
    
    return 0;
}



static void JoinThreeTablesExample(Args _args)
{
    SalesTable salesTable;
    SalesLine salesLine;
    TmpTaxWorkTrans tmpTaxWorkTrans;

    while select * from salesTable
        join salesLine
            where salesTable.SalesId == salesLine.SalesId
    {
        info("SalesTable: " + salesTable.SalesId);

        while select * from tmpTaxWorkTrans
            where tmpTaxWorkTrans.SourceTableId == salesLine.TableId &&
                  tmpTaxWorkTrans.SourceRecId == salesLine.RecId
        {
            info("TmpTaxWorkTrans: " + tmpTaxWorkTrans.SourceRegulateAmountCur);
        }
    }
}


public SourceRegulateAmountCur ansari()
{
    TmpTaxWorkTrans tmpTaxWorkTrans;
    SalesTable localSalesTable = element.args().record();
    SalesLine localSalesLine;

    select TableId, RecId from localSalesLine
        where localSalesLine.SalesId == localSalesTable.SalesId
    join SourceRegulateAmountCur, TaxCode, TransTableId, TransRecId from tmpTaxWorkTrans
        where tmpTaxWorkTrans.TransTableId == localSalesLine.TableId && tmpTaxWorkTrans.TransRecId == localSalesLine.RecId && tmpTaxWorkTrans.TaxCode == 'IdtTireFee';

    if (tmpTaxWorkTrans)
    {
        return tmpTaxWorkTrans.SourceRegulateAmountCur;
    }

    // Handle the case when no record is found
    return 0.0; // Change the default value as needed
}

🚀 More Blogs You Might Like

Explore more articles and keep learning

Data Science Roadmap: From Complete Beginner to Job-Ready Practitioner
Data-Science
Data Science Roadmap: From Complete Beginner to Job-Ready Practitioner

Data Science Roadmap: From Complete Beginner to Job-Ready Practitioner...

👁 10 2026-07-26
Read More →
How AI Is Changing the Way Software Is Made
Data-Science
How AI Is Changing the Way Software Is Made

How AI Is Changing the Way Software Is Made...

👁 7 2026-07-26
Read More →
8 Mistakes That Quietly Slow Down Talented Developers
Personal-Development
8 Mistakes That Quietly Slow Down Talented Developers

8 Mistakes That Quietly Slow Down Talented Developers...

👁 29 2026-07-12
Read More →
Does religion teach hatred?
islam
Does religion teach hatred?

It is easy to spread hatred in the name of religion, but understanding the true message of religion is much de...

👁 319 2026-06-30
Read More →