Minggu, 14 April 2019

simple Logic for Grouping some records

Check this out :

thanks to Tukang Ojek ASP who create this simple logic.

ListPaymentGenralJournalAccount2V       viewPayment;
    CustVendAC                              CustVendAC,lastvalue;
    Amount                                  sumAmount;
    int                                     i=1;
    int                                     numofrecord;
    

while select viewPayment
    where viewPayment.JournalNum == ListPaymentGenralJournalAccount2V.JournalNum
    {
        CustVendAC = viewPayment.CustVendACcount();
        numofrecord += 1;
        if(CustVendAC == lastvalue)
        {
            sumAmount += viewPayment.AccountingCurrencyAmount;
            info(strFmt("%1",sumAmount));

        }
        else if(CustVendAC != lastvalue && i != 1)
        {
            info("beda");
            sumAmount = viewPayment.AccountingCurrencyAmount;
            info(strFmt("%1",sumAmount));
        }
        lastvalue = CustVendAC;
        i += 1;
    }

Tidak ada komentar:

Posting Komentar

Erorr CS1963 - An expression tree may not contain a dynamic operation.

Kali ini saya mendapatkan erorr dengan code CS1963, padahal sebelumnya saya sudah mendefinisikan 'var item in Model' di @foreach(var...