Project

General

Profile

Edit Copy Actions

Feature #192

open

Ledger History

Added by Junaid M almost 2 years ago. Updated 3 months ago.

Status:
Reopen Bugs Testing Done
Priority:
Normal
Target version:
Start date:
05/12/2023
Due date:
% Done:

90%

Estimated time:
Owner(Agency):
Travvise
Time Taken(HH):
Module:
Ledger History
Tested By:
Code Reviewed By:

Description

Coding Ledger History


Add

Subtasks


Add

Related issues

Actions #1

Updated by Junaid M almost 2 years ago

  • Tracker changed from Bug to Feature
  • Assignee changed from Junaid M to Amal Pious
Actions #2

Updated by Amal Pious almost 2 years ago

  • Status changed from New to Coding Started
  • Start date changed from 05/09/2023 to 05/12/2023
  • % Done changed from 0 to 40

Updated by Amal Pious almost 2 years ago

  • Status changed from Coding Started to New
  • % Done changed from 40 to 0

GUI Done

ISSUE FOUNDED
1.CORRECT ALLIGMENT OF BRANCH FIELD
2.CORRECT GRID FILTER FIELDS WHILE EXPANDING
3.ADD ERASE OPTION

Actions #4

Updated by Junaid M almost 2 years ago

  • Assignee changed from Amal Pious to Junaid M
Actions #5

Updated by Anil KV over 1 year ago

  • Assignee changed from Junaid M to travvise Admin

Updated by Anil KV 8 months ago

->Currency Selectbox items
-All Currency Code
-Base1(Currency Code)
-Base2(Currency Code)
***Loading and Work flow checking +Ledger Statement+
->Delete Tab to Deleted
->Action Date fill
-Action From - Transaction Date TO + 1
-Action To - Current Date
-> Add Column Split each tab list - Created Time(after Create By), Modified Time(After Modified By), Deleted Time(After Deleted By)

Updated by Anil KV 8 months ago

GUI Change:-

-> Add 'Ref' And Narration Columns after status - all tabs

Updated by Anil KV 8 months ago

  • Status changed from New to Ready for Coding
  • % Done changed from 0 to 20

Note:- This logic and SQL not full fill, Coding this logic base and commit, I(Anil) will fix all cases
Ref: Document History
SQL:-

    SELECT tr.dat_transaction,
            tr.vhr_ledg_currency,
            tr.dbl_ledg_cur_debit,
        tr.dbl_ledg_cur_credit.
            tr.dbl_base_cur_debit,
        tr.dbl_base_cur_credit,
        tr.dbl_cons_cur_debit,
            tr.dbl_cons_cur_credit,

            NULL AS int_sys_action_log_id,
            NULL AS fk_created_user_log_id,
        NULL AS dtm_created_log,
        NULL AS fk_last_modified_user_log_id,
        NULL AS dtm_last_modified_log,
        NULL AS fk_deleted_user_log_id,
        NULL AS dtm_deleted_log,

        doc.pk_documents_id,
            doc.vhr_document_no,
            doc.fk_ledger_id,
        doc.int_sys_action_id,
            doc.fk_created_user_id,
        doc.dtm_created,
        doc.fk_last_modified_user_id,
        doc.dtm_last_modified,
        doc.fk_deleted_user_id,
        doc.dtm_deleted
        FROM transaction.tbl_transaction tr
            LEFT JOIN document.tbl_documents doc
                ON tr.fk_documents_id = doc.pk_documents_id
        WHERE tr.sin_posting_status = 1
            AND tr.sin_transaction_status = 1
            AND tr.sin_document_status = 1
            AND tr.fk_ledger_id = 1
            AND tr.fk_main_ledger_id = 1
            AND tr.fk_branch_id = 1
            AND tr.fk_department_id = 1

         UNION ALL

    SELECT trlog.dat_transaction,
            trlog.vhr_ledg_currency,
            trlog.dbl_ledg_cur_debit,
        trlog.dbl_ledg_cur_credit.
            trlog.dbl_base_cur_debit,
        trlog.dbl_base_cur_credit,
        trlog.dbl_cons_cur_debit,
            trlog.dbl_cons_cur_credit,

        doclog.int_sys_action_id AS int_sys_action_log_id,
            doclog.fk_created_user_id AS fk_created_user_log_id,
        doclog.dtm_created AS dtm_created_log,
        doclog.fk_last_modified_user_id AS fk_last_modified_user_log_id,
        doclog.dtm_last_modified AS dtm_last_modified_log,
        doclog.fk_deleted_user_id AS fk_deleted_user_log_id,
        doclog.dtm_deleted AS dtm_deleted_log,

        doc.pk_documents_id,
            doc.vhr_document_no,
            doc.fk_ledger_id,
        doc.int_sys_action_id,
            doc.fk_created_user_id,
        doc.dtm_created,
        doc.fk_last_modified_user_id,
        doc.dtm_last_modified,
        doc.fk_deleted_user_id,
        doc.dtm_deleted
        FROM tbl_transaction trlog
        LEFT JOIN tbl_documents_log doclog
                ON trlog.fk_documents_log_id = doclog.pk_documents_log_id
            LEFT JOIN document.tbl_documents doc
                ON trlog.fk_documents_id = doc.pk_documents_id
        WHERE trlog.sin_posting_status = 1
            AND trlog.sin_transaction_status = 1
            AND trlog.sin_document_status = 1
            AND trlog.fk_ledger_id = 1
            AND trlog.fk_main_ledger_id = 1
            AND trlog.fk_branch_id = 1
            AND trlog.fk_department_id = 1

Logic
Input Change
--------------
datActionDateTo = datActionDateTo Add 1 Day
//datActionDateFrom and datActionDateTo ['01/01/2024 00:00:00'] time part need 0

SQL
=====

Logic
--------------
blnOlbObSetedADoc = False
blnMainDocumentRecordIn = True
blnMainDocumentRecord = False
blnLastLogRecord = False
binPrvDocumentId = 0
binPrvDocumentLogId = 0 
dblPrevTransactionAmount = 0.00
dblOldBalance = 0.00
strTab = ''
lstEachLedgerHistoryData = []
For loop Database Record
        // Create Model
        // Fill the record to Modele

    blnMainDocumentRecord = False
    blnLastLogRecord = False
        if binPrvDocumentId != binDocumentId
        blnOlbObSetedADoc = False
        dblPrevTransactionAmount = 0

        // Set Prv Document 
        if lstEachLedgerHistoryData.legth > 0
                        // ReCheck Tab
            if binPrvDocumentLogId is NULL/0 and strTab == 'UPDATED'
                strTab = 'LEDGER_CHANGED'
            END IF

            // Some value Calculation - Previous, Diff

            // Set Data
            if  strTab == "NEW" 
                         lstNew = [...lstNew, ...lstEachLedgerHistoryData]
                else if strTab == "UPDATED" 
                         lstUpdated = [...lstUpdated, ...lstEachLedgerHistoryData]
                ...
            END IF

            lstEachLedgerHistoryData = []
        END IF

        strTab = ''
        if pk_documents_log_id is NULL/0
            blnMainDocumentRecord = True
            blnMainDocumentRecordIn = True
                        if int_sys_action_id >= 1 AND  dtm_created and datActionDateFrom < dtm_created and dtm_created < datActionDateTo
                strTab = 'NEW'
                    else if int_sys_action_id > 1 AND dtm_last_modified and datActionDateFrom < dtm_last_modified and dtm_last_modified < datActionDateTo
                                strTab = 'UPDATED'
                if dtm_created and (datActionDateFrom > dtm_created or dtm_created > datActionDateTo)
                    strTab = 'PERIOD_CHANGED'
                END IF
                        elseif int_sys_action_id == -1 AND dtm_deleted and datActionDateFrom < dtm_deleted and dtm_deleted < datActionDateTo
                strTab = 'DELETED'

        else
            blnLastLogRecord = True
            blnMainDocumentRecordIn = False
            strTab = 'LEDGER_CHANGED'
                END IF
    END IF

    // ReCheck Tab
    //if blnMainDocumentRecordIn == False:
    //END IF

    // Calculate
    dblDiffAmount = (debit - credit) - dblPrevTransactionAmount
    if int_sys_action_id == -1
        dblDiffAmount = (debit - credit)
    END IF 

    if  strTab == "NEW" 
        dblTotalNew += 
    else if strTab == "UPDATED" 
    else if strTab == "PERIOD_CHANGED" 
    else if strTab == "LEDGER_CHANGED" 
    else if strTab == "DELETED" 
    END IF

    if pk_documents_log_id and blnOlbObSetedADoc == False
        if int_sys_action_id > 1 AND dtm_last_modified and datActionDateFrom < dtm_last_modified 
            dblOldBalance += (debit - credit)
            blnOlbObSetedADoc = True
        END IF
        ELSE if int_sys_action_id == -1 AND dtm_deleted and datActionDateFrom < dtm_deleted
            dblOldBalance += (debit - credit)
            blnOlbObSetedADoc = True
        END IF
    END IF

        // Set Record in tmp list
    lstEachLedgerHistoryData.Add(Model)

        // Set Prv doc id
        binPrvDocumentId = binDocumentId
    binPrvDocumentLogId = binDocumentLogId
    dblPrevTransactionAmount = debit - credit
        END LOOP

// Set Last Document Data
if lstEachLedgerHistoryData.legth > 0
        // ReCheck Tab
    if binPrvDocumentLogId is NULL/0 and strTab == 'UPDATED'
        strTab = 'LEDGER_CHANGED'
    END IF

    // Set Data
    if  strTab == "NEW" 
                 lstNew = [...lstNew, ...lstEachLedgerHistoryData]
        else if strTab == "UPDATED" 
                 lstUpdated = [...lstUpdated, ...lstEachLedgerHistoryData]
        ...
    END IF

Actions #9

Updated by Anil KV 8 months ago

  • Assignee changed from travvise Admin to Greeshma S
Actions #10

Updated by Anil KV 7 months ago

  • Assignee changed from Greeshma S to Baseem Shan
Actions #11

Updated by Anil KV 5 months ago

  • Assignee changed from Baseem Shan to Augustin Jose
Actions #12

Updated by Augustin Jose 4 months ago

  • Status changed from Ready for Coding to Coding Started
  • % Done changed from 20 to 30
Actions #13

Updated by Augustin Jose 4 months ago

  • Status changed from Coding Started to Coding Done
  • % Done changed from 30 to 60
Actions #14

Updated by Arathy PS 3 months ago

  • Status changed from Coding Done to Testing Started

Updated by Arathy PS 3 months ago

  • Status changed from Testing Started to Reopen Bugs
  • % Done changed from 60 to 50

ISSUE FOUND
-------------------------------------------
1. Not filtering data based on the user field.
2. Print of summary tab not in correct format.

Actions #16

Updated by Augustin Jose 3 months ago

  • Status changed from Reopen Bugs to Reopen Bugs Coding Done
  • % Done changed from 50 to 70
Actions #17

Updated by Theja Ponon 3 months ago

  • Status changed from Reopen Bugs Coding Done to Reopen Bugs Testing Done
  • % Done changed from 70 to 90
Edit Copy Actions

Also available in: Atom PDF