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

What is Bounce Rate in SEO? Complete Guide for Beginners
search-engine-optimization
What is Bounce Rate in SEO? Complete Guide for Beginners

Learn what bounce rate is in SEO, how it is calculated, why it matters, common causes of high bounce rates, an...

👁 28 2026-05-24
Read More →
Comprehensive Interviewer Guide - Detailed Article
skill
Comprehensive Interviewer Guide - Detailed Article

Learn how to conduct effective interviews with this comprehensive interviewer guide. Explore hiring strategies...

👁 43 2026-05-22
Read More →
Five Industry Shifts Reshaping the AI Ecosystem (2026 Trends)
skill
Five Industry Shifts Reshaping the AI Ecosystem (2026 Trends)

Five Industry Shifts Reshaping the AI Ecosystem (2026 Trends)...

👁 38 2026-05-19
Read More →
How to Grow Your Business Mindset Step by Step
skill
How to Grow Your Business Mindset Step by Step

Learn how to develop and grow a successful business mindset step by step. Discover entrepreneurial thinking, p...

👁 56 2026-05-09
Read More →