$-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKY9170957Image160524080234.png$N$~ Message : UpdateEkycdata StackTrace : tpDocimageforBank Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 357183488 Shut down : N Username : MOBBO Date/Time : 16/05/2024 8:02:55 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKY9170957Image160524080234.png$N$ Message : UpdateEkycdata StackTrace : lcDocsrtring[i] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 357199872 Shut down : N Username : MOBBO Date/Time : 16/05/2024 8:02:55 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKY9170957Image160524080234.png Message : UpdateEkycdata StackTrace : lcProoffile[0] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 357199872 Shut down : N Username : MOBBO Date/Time : 16/05/2024 8:02:55 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : 01~Error Description : ORA-02291: integrity constraint (LDBO.FK_CLIENTBANK) violated - parent key not found Method : PaymentReq_SaveLine : 36368 Message : Paymentrequest_save StackTrace : at OracleInternal.ServiceObjects.OracleConnectionImpl.VerifyExecution(Int32& cursorId, Boolean bThrowArrayBindRelatedErrors, SqlStatementType sqlStatementType, Int32 arrayBindCount, OracleException& exceptionForArrayBindDML, Boolean& hasMoreRowsInDB, Boolean bFirstIterationDone) at OracleInternal.ServiceObjects.OracleCommandImpl.ExecuteNonQuery(String commandText, OracleParameterCollection paramColl, CommandType commandType, OracleConnectionImpl connectionImpl, Int32 longFetchSize, Int64 clientInitialLOBFS, OracleDependencyImpl orclDependencyImpl, Int64[]& scnFromExecution, OracleParameterCollection& bindByPositionParamColl, Boolean& bBindParamPresent, OracleException& exceptionForArrayBindDML, OracleConnection connection, OracleLogicalTransaction& oracleLogicalTransaction, Boolean isFromEF) at Oracle.ManagedDataAccess.Client.OracleCommand.ExecuteNonQuery() at clientlevel.Thinclientlevel.Clientlogin.PaymentReq_Save(String tcPaymentRequestXmlFile, String tcFilePath, Int32 tnProductCode, String tcEntryMethod, Cliole loLdcommon, String tcClientcode) in File25:line 36368 Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 579805184 Shut down : N Username : MOBBO Date/Time : 16/05/2024 8:09:11 PM Connection : Closed =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKY9170957Image160524081226.png$N$~ Message : UpdateEkycdata StackTrace : tpDocimageforBank Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 315129856 Shut down : N Username : MOBBO Date/Time : 16/05/2024 8:12:43 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKY9170957Image160524081226.png$N$ Message : UpdateEkycdata StackTrace : lcDocsrtring[i] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 315170816 Shut down : N Username : MOBBO Date/Time : 16/05/2024 8:12:43 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKY9170957Image160524081226.png Message : UpdateEkycdata StackTrace : lcProoffile[0] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 315195392 Shut down : N Username : MOBBO Date/Time : 16/05/2024 8:12:43 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Select tblFirmcreation.cshortname as cShortname From tblFirmcreation tblFirmcreation Where tblFirmcreation.cUserFirmcode='NBS-000001' Title : 01~Error Description : Value cannot be null. Parameter name: dataTable Method : AgeingacrossyearLine : 46316 Message : Ageingacrossyear StackTrace : at System.Data.Common.DataAdapter.Fill(DataTable[] dataTables, IDataReader dataReader, Int32 startRecord, Int32 maxRecords) at Oracle.ManagedDataAccess.Client.OracleDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable) at clientlevel.Thinclientlevel.Clientlogin.Ageingacrossyear(DateTime tdTransactiondate, Int32 tnTotaldays1, Int32 tnTotaldays2, Int32 tnTotaldays3, Int32 tnAngleselection, Int32 tnTotaldays4, Int32 tnTotaldays5, Int32 tnTotaldays6, Cliole loLdcommon, Int32 tnTotaldays7, Int32 tnTotaldays8, Int32 tnTotaldays9, Int32 tnTotaldays10, Int32 tnTotaldays11, Int32 tnTotaldays12, Int32 tnIncludepreviousyear, Int32 tnIgnorebounced, Int32 tnonlyReconciledentries, Int32 tnTerminalcodejoin, String& tcCashpayindate, String& tcFopayindate, Int32 tnAgeingonTransactiondate, String tcClientcode, Double tnAmount, String& tcSebiageingdate) in File25:line 46316 Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 633524224 Shut down : N Username : MOBBO Date/Time : 16/05/2024 8:29:52 PM Connection : Closed =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Select tblFirmcreation.cshortname as cShortname From tblFirmcreation tblFirmcreation Where tblFirmcreation.cUserFirmcode='NBS-000001' Title : 01~Error Description : Value cannot be null. Parameter name: dataTable Method : AgeingacrossyearLine : 46316 Message : Ageingacrossyear StackTrace : at System.Data.Common.DataAdapter.Fill(DataTable[] dataTables, IDataReader dataReader, Int32 startRecord, Int32 maxRecords) at Oracle.ManagedDataAccess.Client.OracleDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable) at clientlevel.Thinclientlevel.Clientlogin.Ageingacrossyear(DateTime tdTransactiondate, Int32 tnTotaldays1, Int32 tnTotaldays2, Int32 tnTotaldays3, Int32 tnAngleselection, Int32 tnTotaldays4, Int32 tnTotaldays5, Int32 tnTotaldays6, Cliole loLdcommon, Int32 tnTotaldays7, Int32 tnTotaldays8, Int32 tnTotaldays9, Int32 tnTotaldays10, Int32 tnTotaldays11, Int32 tnTotaldays12, Int32 tnIncludepreviousyear, Int32 tnIgnorebounced, Int32 tnonlyReconciledentries, Int32 tnTerminalcodejoin, String& tcCashpayindate, String& tcFopayindate, Int32 tnAgeingonTransactiondate, String tcClientcode, Double tnAmount, String& tcSebiageingdate) in File25:line 46316 Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 751366144 Shut down : N Username : MOBBO Date/Time : 16/05/2024 9:50:16 PM Connection : Closed =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Select tblFirmcreation.cshortname as cShortname From tblFirmcreation tblFirmcreation Where tblFirmcreation.cUserFirmcode='NBS-000001' Title : 01~Error Description : Value cannot be null. Parameter name: dataTable Method : AgeingacrossyearLine : 46316 Message : Ageingacrossyear StackTrace : at System.Data.Common.DataAdapter.Fill(DataTable[] dataTables, IDataReader dataReader, Int32 startRecord, Int32 maxRecords) at Oracle.ManagedDataAccess.Client.OracleDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable) at clientlevel.Thinclientlevel.Clientlogin.Ageingacrossyear(DateTime tdTransactiondate, Int32 tnTotaldays1, Int32 tnTotaldays2, Int32 tnTotaldays3, Int32 tnAngleselection, Int32 tnTotaldays4, Int32 tnTotaldays5, Int32 tnTotaldays6, Cliole loLdcommon, Int32 tnTotaldays7, Int32 tnTotaldays8, Int32 tnTotaldays9, Int32 tnTotaldays10, Int32 tnTotaldays11, Int32 tnTotaldays12, Int32 tnIncludepreviousyear, Int32 tnIgnorebounced, Int32 tnonlyReconciledentries, Int32 tnTerminalcodejoin, String& tcCashpayindate, String& tcFopayindate, Int32 tnAgeingonTransactiondate, String tcClientcode, Double tnAmount, String& tcSebiageingdate) in File25:line 46316 Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 491610112 Shut down : N Username : MOBBO Date/Time : 16/05/2024 10:25:07 PM Connection : Closed =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BankPDF16052024195619.pdf$N$~ Message : UpdateEkycdata StackTrace : tpDocimageforBank Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 756809728 Shut down : N Username : MOBBO Date/Time : 16/05/2024 11:26:48 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BankPDF16052024195619.pdf$N$ Message : UpdateEkycdata StackTrace : lcDocsrtring[i] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 756826112 Shut down : N Username : MOBBO Date/Time : 16/05/2024 11:26:48 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BankPDF16052024195619.pdf Message : UpdateEkycdata StackTrace : lcProoffile[0] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 756826112 Shut down : N Username : MOBBO Date/Time : 16/05/2024 11:26:48 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BankPDF16052024195619.pdf$N$~ Message : UpdateEkycdata StackTrace : tpDocimageforBank Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 775647232 Shut down : N Username : MOBBO Date/Time : 16/05/2024 11:28:22 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BankPDF16052024195619.pdf$N$ Message : UpdateEkycdata StackTrace : lcDocsrtring[i] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 775647232 Shut down : N Username : MOBBO Date/Time : 16/05/2024 11:28:22 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BankPDF16052024195619.pdf Message : UpdateEkycdata StackTrace : lcProoffile[0] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 775647232 Shut down : N Username : MOBBO Date/Time : 16/05/2024 11:28:22 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BankPDF16052024195619.pdf$N$~ Message : UpdateEkycdata StackTrace : tpDocimageforBank Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 367648768 Shut down : N Username : MOBBO Date/Time : 16/05/2024 11:33:32 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BankPDF16052024195619.pdf$N$ Message : UpdateEkycdata StackTrace : lcDocsrtring[i] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 367665152 Shut down : N Username : MOBBO Date/Time : 16/05/2024 11:33:32 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BankPDF16052024195619.pdf Message : UpdateEkycdata StackTrace : lcProoffile[0] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 367665152 Shut down : N Username : MOBBO Date/Time : 16/05/2024 11:33:32 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Select tblFirmcreation.cshortname as cShortname From tblFirmcreation tblFirmcreation Where tblFirmcreation.cUserFirmcode='NBS-000001' Title : 01~Error Description : Value cannot be null. Parameter name: dataTable Method : AgeingacrossyearLine : 46316 Message : Ageingacrossyear StackTrace : at System.Data.Common.DataAdapter.Fill(DataTable[] dataTables, IDataReader dataReader, Int32 startRecord, Int32 maxRecords) at Oracle.ManagedDataAccess.Client.OracleDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable) at clientlevel.Thinclientlevel.Clientlogin.Ageingacrossyear(DateTime tdTransactiondate, Int32 tnTotaldays1, Int32 tnTotaldays2, Int32 tnTotaldays3, Int32 tnAngleselection, Int32 tnTotaldays4, Int32 tnTotaldays5, Int32 tnTotaldays6, Cliole loLdcommon, Int32 tnTotaldays7, Int32 tnTotaldays8, Int32 tnTotaldays9, Int32 tnTotaldays10, Int32 tnTotaldays11, Int32 tnTotaldays12, Int32 tnIncludepreviousyear, Int32 tnIgnorebounced, Int32 tnonlyReconciledentries, Int32 tnTerminalcodejoin, String& tcCashpayindate, String& tcFopayindate, Int32 tnAgeingonTransactiondate, String tcClientcode, Double tnAmount, String& tcSebiageingdate) in File25:line 46316 Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 523481088 Shut down : N Username : MOBBO Date/Time : 17/05/2024 5:38:29 AM Connection : Closed =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : 01~Error Description : ORA-02291: integrity constraint (LDBO.FK_CLIENTBANK) violated - parent key not found Method : PaymentReq_SaveLine : 36368 Message : Paymentrequest_save StackTrace : at OracleInternal.ServiceObjects.OracleConnectionImpl.VerifyExecution(Int32& cursorId, Boolean bThrowArrayBindRelatedErrors, SqlStatementType sqlStatementType, Int32 arrayBindCount, OracleException& exceptionForArrayBindDML, Boolean& hasMoreRowsInDB, Boolean bFirstIterationDone) at OracleInternal.ServiceObjects.OracleCommandImpl.ExecuteNonQuery(String commandText, OracleParameterCollection paramColl, CommandType commandType, OracleConnectionImpl connectionImpl, Int32 longFetchSize, Int64 clientInitialLOBFS, OracleDependencyImpl orclDependencyImpl, Int64[]& scnFromExecution, OracleParameterCollection& bindByPositionParamColl, Boolean& bBindParamPresent, OracleException& exceptionForArrayBindDML, OracleConnection connection, OracleLogicalTransaction& oracleLogicalTransaction, Boolean isFromEF) at Oracle.ManagedDataAccess.Client.OracleCommand.ExecuteNonQuery() at clientlevel.Thinclientlevel.Clientlogin.PaymentReq_Save(String tcPaymentRequestXmlFile, String tcFilePath, Int32 tnProductCode, String tcEntryMethod, Cliole loLdcommon, String tcClientcode) in File25:line 36368 Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 449245184 Shut down : N Username : MOBBO Date/Time : 17/05/2024 8:17:53 AM Connection : Closed =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : 01~Error Description : ORA-02291: integrity constraint (LDBO.FK_CLIENTBANK) violated - parent key not found Method : PaymentReq_SaveLine : 36368 Message : Paymentrequest_save StackTrace : at OracleInternal.ServiceObjects.OracleConnectionImpl.VerifyExecution(Int32& cursorId, Boolean bThrowArrayBindRelatedErrors, SqlStatementType sqlStatementType, Int32 arrayBindCount, OracleException& exceptionForArrayBindDML, Boolean& hasMoreRowsInDB, Boolean bFirstIterationDone) at OracleInternal.ServiceObjects.OracleCommandImpl.ExecuteNonQuery(String commandText, OracleParameterCollection paramColl, CommandType commandType, OracleConnectionImpl connectionImpl, Int32 longFetchSize, Int64 clientInitialLOBFS, OracleDependencyImpl orclDependencyImpl, Int64[]& scnFromExecution, OracleParameterCollection& bindByPositionParamColl, Boolean& bBindParamPresent, OracleException& exceptionForArrayBindDML, OracleConnection connection, OracleLogicalTransaction& oracleLogicalTransaction, Boolean isFromEF) at Oracle.ManagedDataAccess.Client.OracleCommand.ExecuteNonQuery() at clientlevel.Thinclientlevel.Clientlogin.PaymentReq_Save(String tcPaymentRequestXmlFile, String tcFilePath, Int32 tnProductCode, String tcEntryMethod, Cliole loLdcommon, String tcClientcode) in File25:line 36368 Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 458543104 Shut down : N Username : MOBBO Date/Time : 17/05/2024 8:18:09 AM Connection : Closed =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Select tblFirmcreation.cshortname as cShortname From tblFirmcreation tblFirmcreation Where tblFirmcreation.cUserFirmcode='NBS-000001' Title : 01~Error Description : Value cannot be null. Parameter name: dataTable Method : AgeingacrossyearLine : 46316 Message : Ageingacrossyear StackTrace : at System.Data.Common.DataAdapter.Fill(DataTable[] dataTables, IDataReader dataReader, Int32 startRecord, Int32 maxRecords) at Oracle.ManagedDataAccess.Client.OracleDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable) at clientlevel.Thinclientlevel.Clientlogin.Ageingacrossyear(DateTime tdTransactiondate, Int32 tnTotaldays1, Int32 tnTotaldays2, Int32 tnTotaldays3, Int32 tnAngleselection, Int32 tnTotaldays4, Int32 tnTotaldays5, Int32 tnTotaldays6, Cliole loLdcommon, Int32 tnTotaldays7, Int32 tnTotaldays8, Int32 tnTotaldays9, Int32 tnTotaldays10, Int32 tnTotaldays11, Int32 tnTotaldays12, Int32 tnIncludepreviousyear, Int32 tnIgnorebounced, Int32 tnonlyReconciledentries, Int32 tnTerminalcodejoin, String& tcCashpayindate, String& tcFopayindate, Int32 tnAgeingonTransactiondate, String tcClientcode, Double tnAmount, String& tcSebiageingdate) in File25:line 46316 Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 725606400 Shut down : N Username : MOBBO Date/Time : 17/05/2024 9:08:25 AM Connection : Closed =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKCHA1866Image170524091000.png$N$~ Message : UpdateEkycdata StackTrace : tpDocimageforBank Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 806354944 Shut down : N Username : MOBBO Date/Time : 17/05/2024 9:09:14 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKCHA1866Image170524091000.png$N$ Message : UpdateEkycdata StackTrace : lcDocsrtring[i] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 806354944 Shut down : N Username : MOBBO Date/Time : 17/05/2024 9:09:14 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKCHA1866Image170524091000.png Message : UpdateEkycdata StackTrace : lcProoffile[0] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 806354944 Shut down : N Username : MOBBO Date/Time : 17/05/2024 9:09:14 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKA2138807Image170524091744.png$N$~ Message : UpdateEkycdata StackTrace : tpDocimageforBank Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 612065280 Shut down : N Username : MOBBO Date/Time : 17/05/2024 9:17:58 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKA2138807Image170524091744.png$N$ Message : UpdateEkycdata StackTrace : lcDocsrtring[i] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 612081664 Shut down : N Username : MOBBO Date/Time : 17/05/2024 9:17:58 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKA2138807Image170524091744.png Message : UpdateEkycdata StackTrace : lcProoffile[0] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 612081664 Shut down : N Username : MOBBO Date/Time : 17/05/2024 9:17:58 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKA2131149Image170524092429.png$N$~ Message : UpdateEkycdata StackTrace : tpDocimageforBank Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 767991808 Shut down : N Username : MOBBO Date/Time : 17/05/2024 9:24:48 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKA2131149Image170524092429.png$N$ Message : UpdateEkycdata StackTrace : lcDocsrtring[i] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 768040960 Shut down : N Username : MOBBO Date/Time : 17/05/2024 9:24:48 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKA2131149Image170524092429.png Message : UpdateEkycdata StackTrace : lcProoffile[0] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 768065536 Shut down : N Username : MOBBO Date/Time : 17/05/2024 9:24:48 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKS3120014Image170524093525.png$N$~ Message : UpdateEkycdata StackTrace : tpDocimageforBank Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 675094528 Shut down : N Username : MOBBO Date/Time : 17/05/2024 9:35:44 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKS3120014Image170524093525.png$N$ Message : UpdateEkycdata StackTrace : lcDocsrtring[i] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 675135488 Shut down : N Username : MOBBO Date/Time : 17/05/2024 9:35:44 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKS3120014Image170524093525.png Message : UpdateEkycdata StackTrace : lcProoffile[0] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 675160064 Shut down : N Username : MOBBO Date/Time : 17/05/2024 9:35:44 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKANV01Image170524094113.png$N$~ Message : UpdateEkycdata StackTrace : tpDocimageforBank Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 740335616 Shut down : N Username : MOBBO Date/Time : 17/05/2024 9:41:25 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKANV01Image170524094113.png$N$ Message : UpdateEkycdata StackTrace : lcDocsrtring[i] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 740335616 Shut down : N Username : MOBBO Date/Time : 17/05/2024 9:41:25 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKANV01Image170524094113.png Message : UpdateEkycdata StackTrace : lcProoffile[0] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 740335616 Shut down : N Username : MOBBO Date/Time : 17/05/2024 9:41:25 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKANV01Image170524094113.png$N$~ Message : UpdateEkycdata StackTrace : tpDocimageforBank Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 684101632 Shut down : N Username : MOBBO Date/Time : 17/05/2024 9:55:02 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKANV01Image170524094113.png$N$ Message : UpdateEkycdata StackTrace : lcDocsrtring[i] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 684118016 Shut down : N Username : MOBBO Date/Time : 17/05/2024 9:55:02 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKANV01Image170524094113.png Message : UpdateEkycdata StackTrace : lcProoffile[0] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 684118016 Shut down : N Username : MOBBO Date/Time : 17/05/2024 9:55:02 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKBSP019Image170524095800.png$N$~ Message : UpdateEkycdata StackTrace : tpDocimageforBank Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 824410112 Shut down : N Username : MOBBO Date/Time : 17/05/2024 9:58:28 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKBSP019Image170524095800.png$N$ Message : UpdateEkycdata StackTrace : lcDocsrtring[i] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 824410112 Shut down : N Username : MOBBO Date/Time : 17/05/2024 9:58:28 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKBSP019Image170524095800.png Message : UpdateEkycdata StackTrace : lcProoffile[0] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 824410112 Shut down : N Username : MOBBO Date/Time : 17/05/2024 9:58:28 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKANV01Image170524094113.png$N$~ Message : UpdateEkycdata StackTrace : tpDocimageforBank Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 398835712 Shut down : N Username : MOBBO Date/Time : 17/05/2024 10:03:12 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKANV01Image170524094113.png$N$ Message : UpdateEkycdata StackTrace : lcDocsrtring[i] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 398852096 Shut down : N Username : MOBBO Date/Time : 17/05/2024 10:03:12 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKANV01Image170524094113.png Message : UpdateEkycdata StackTrace : lcProoffile[0] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 398852096 Shut down : N Username : MOBBO Date/Time : 17/05/2024 10:03:12 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKANV01Image170524094113.png$N$~ Message : UpdateEkycdata StackTrace : tpDocimageforBank Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 607846400 Shut down : N Username : MOBBO Date/Time : 17/05/2024 10:05:17 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKANV01Image170524094113.png$N$ Message : UpdateEkycdata StackTrace : lcDocsrtring[i] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 607846400 Shut down : N Username : MOBBO Date/Time : 17/05/2024 10:05:17 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKANV01Image170524094113.png Message : UpdateEkycdata StackTrace : lcProoffile[0] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 607846400 Shut down : N Username : MOBBO Date/Time : 17/05/2024 10:05:17 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKT5890049Image170524101427.png$N$~ Message : UpdateEkycdata StackTrace : tpDocimageforBank Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 1049509888 Shut down : N Username : MOBBO Date/Time : 17/05/2024 10:14:46 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKT5890049Image170524101427.png$N$ Message : UpdateEkycdata StackTrace : lcDocsrtring[i] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 1049550848 Shut down : N Username : MOBBO Date/Time : 17/05/2024 10:14:46 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKT5890049Image170524101427.png Message : UpdateEkycdata StackTrace : lcProoffile[0] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 1049575424 Shut down : N Username : MOBBO Date/Time : 17/05/2024 10:14:46 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Select tblFirmcreation.cshortname as cShortname From tblFirmcreation tblFirmcreation Where tblFirmcreation.cUserFirmcode='NBS-000001' Title : 01~Error Description : Value cannot be null. Parameter name: dataTable Method : AgeingacrossyearLine : 46316 Message : Ageingacrossyear StackTrace : at System.Data.Common.DataAdapter.Fill(DataTable[] dataTables, IDataReader dataReader, Int32 startRecord, Int32 maxRecords) at Oracle.ManagedDataAccess.Client.OracleDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable) at clientlevel.Thinclientlevel.Clientlogin.Ageingacrossyear(DateTime tdTransactiondate, Int32 tnTotaldays1, Int32 tnTotaldays2, Int32 tnTotaldays3, Int32 tnAngleselection, Int32 tnTotaldays4, Int32 tnTotaldays5, Int32 tnTotaldays6, Cliole loLdcommon, Int32 tnTotaldays7, Int32 tnTotaldays8, Int32 tnTotaldays9, Int32 tnTotaldays10, Int32 tnTotaldays11, Int32 tnTotaldays12, Int32 tnIncludepreviousyear, Int32 tnIgnorebounced, Int32 tnonlyReconciledentries, Int32 tnTerminalcodejoin, String& tcCashpayindate, String& tcFopayindate, Int32 tnAgeingonTransactiondate, String tcClientcode, Double tnAmount, String& tcSebiageingdate) in File25:line 46316 Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 582123520 Shut down : N Username : MOBBO Date/Time : 17/05/2024 10:43:51 AM Connection : Closed =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Select tblFirmcreation.cshortname as cShortname From tblFirmcreation tblFirmcreation Where tblFirmcreation.cUserFirmcode='NBS-000001' Title : 01~Error Description : Value cannot be null. Parameter name: dataTable Method : AgeingacrossyearLine : 46316 Message : Ageingacrossyear StackTrace : at System.Data.Common.DataAdapter.Fill(DataTable[] dataTables, IDataReader dataReader, Int32 startRecord, Int32 maxRecords) at Oracle.ManagedDataAccess.Client.OracleDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable) at clientlevel.Thinclientlevel.Clientlogin.Ageingacrossyear(DateTime tdTransactiondate, Int32 tnTotaldays1, Int32 tnTotaldays2, Int32 tnTotaldays3, Int32 tnAngleselection, Int32 tnTotaldays4, Int32 tnTotaldays5, Int32 tnTotaldays6, Cliole loLdcommon, Int32 tnTotaldays7, Int32 tnTotaldays8, Int32 tnTotaldays9, Int32 tnTotaldays10, Int32 tnTotaldays11, Int32 tnTotaldays12, Int32 tnIncludepreviousyear, Int32 tnIgnorebounced, Int32 tnonlyReconciledentries, Int32 tnTerminalcodejoin, String& tcCashpayindate, String& tcFopayindate, Int32 tnAgeingonTransactiondate, String tcClientcode, Double tnAmount, String& tcSebiageingdate) in File25:line 46316 Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 691593216 Shut down : N Username : MOBBO Date/Time : 17/05/2024 10:43:59 AM Connection : Closed =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKANV01Image170524104447.png$N$~ Message : UpdateEkycdata StackTrace : tpDocimageforBank Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 983613440 Shut down : N Username : MOBBO Date/Time : 17/05/2024 10:45:06 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKANV01Image170524104447.png$N$ Message : UpdateEkycdata StackTrace : lcDocsrtring[i] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 983613440 Shut down : N Username : MOBBO Date/Time : 17/05/2024 10:45:06 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKANV01Image170524104447.png Message : UpdateEkycdata StackTrace : lcProoffile[0] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 983613440 Shut down : N Username : MOBBO Date/Time : 17/05/2024 10:45:06 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKSCMT1Image170524104559.png$N$~ Message : UpdateEkycdata StackTrace : tpDocimageforBank Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 905658368 Shut down : N Username : MOBBO Date/Time : 17/05/2024 10:46:12 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKSCMT1Image170524104559.png$N$ Message : UpdateEkycdata StackTrace : lcDocsrtring[i] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 905658368 Shut down : N Username : MOBBO Date/Time : 17/05/2024 10:46:12 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKSCMT1Image170524104559.png Message : UpdateEkycdata StackTrace : lcProoffile[0] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 905658368 Shut down : N Username : MOBBO Date/Time : 17/05/2024 10:46:12 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKN3750001Image170524105932.png$N$~ Message : UpdateEkycdata StackTrace : tpDocimageforBank Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 874041344 Shut down : N Username : MOBBO Date/Time : 17/05/2024 10:59:48 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKN3750001Image170524105932.png$N$ Message : UpdateEkycdata StackTrace : lcDocsrtring[i] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 874057728 Shut down : N Username : MOBBO Date/Time : 17/05/2024 10:59:48 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKN3750001Image170524105932.png Message : UpdateEkycdata StackTrace : lcProoffile[0] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 874057728 Shut down : N Username : MOBBO Date/Time : 17/05/2024 10:59:48 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKVA3202Image170524110152.png$N$~ Message : UpdateEkycdata StackTrace : tpDocimageforBank Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 742338560 Shut down : N Username : MOBBO Date/Time : 17/05/2024 11:02:19 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKVA3202Image170524110152.png$N$ Message : UpdateEkycdata StackTrace : lcDocsrtring[i] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 742338560 Shut down : N Username : MOBBO Date/Time : 17/05/2024 11:02:19 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKVA3202Image170524110152.png Message : UpdateEkycdata StackTrace : lcProoffile[0] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 742338560 Shut down : N Username : MOBBO Date/Time : 17/05/2024 11:02:19 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Merge into Tblccmekycdocimages T1 using ( Select 'NBS-000001' as cFirmnumber, 'VA3202' as cClientcode,34098 as nEkycrefno, :lcDocimages as lcDocimage,:lnRequesttype as nRequesttype, :lnTrannumber as nTrannumber,:lcDocimagesname as cDocimagesname , :lcPswprotected as cPswprotected, :lcPassword as cPassword from dual ) T2 on (T1.cFirmnumber=T2.cFirmnumber and T1.cClientcode=T2.cClientcode and T1.nEkycdoucmentno=T2.nEkycrefno and T1.nRequesttype=T2.nRequesttype and T1.nTrannumber=T2.nTrannumber ) when matched then update set pDocimage=T2.lcDocimage, cfilename=T2.cDocimagesname, cPswprotected=T2.cPswprotected,cPassword =T2.cPassword when not matched then Insert (cFirmnumber,cClientcode,nEkycdoucmentno ,nRequesttype, nTrannumber,nStatus,pDocimage,cfilename,cPswprotected, cPassword) Values ('NBS-000001', 'VA3202',34098,T2.nRequesttype , T2.nTrannumber,0, T2.lcDocimage,T2.cDocimagesname, T2.cPswprotected, T2.cPassword) Title : 01~Error Description : Could not find file 'D:\Inetpub\wwwroot\LdMobileService\Download\FinalReKYC_VA3202_638515405354853419.pdf'. Method : UpdateEkycdataLine : 71822 Message : UpdateEkycdata StackTrace : at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) at System.IO.File.InternalReadAllBytes(String path, Boolean checkHost) at ekyc.ekycdata.UpdateEkycdata(Cliole loLdcommon, Int32 tnAngleselection, String tcClientcode, String tcRequstType, String tcMobile, String tcEmailaddress, String tcClientname, String tcFirstname, String tcSecondname, String tcLastname, String tcCorraddressline1, String tcCorraddressline2, String tcCorraddressline3, String tcCorraddresscity, String tnCorrpin, String tcCorrstate, String tcCorrstateother, String tcCorrcountry, String tcCorraddressproof, String tcCorraddressrefid, String tdCorraddressproofissuedt, String tdCorraddressproofexpirydt, String tcPfraddressline1, String tcPfraddressline2, String tcPfraddressline3, String tcPfraddresscity, Int32 tnPfrpin, String tcPfrstate, String tcPfrstateother, String tcPfrcountry, String tcPfraddressproof, String tcPfraddressproofrefid, String tdPfraddressproofissuedt, String tdPfraddressproofexpirydt, String tcResdstatuscode, String tcGender, String tcMaritalstatus, String tcFatherSpousename, String tcNationality, String tcPrefixmaidenname, String tcApplicantMaidenname, String tcPrefixfatherspouse, String tcPrefixmothername, String tcMothername, String tcMothermaidenname, String tcFatcaProofofaddress, String tcFatcaIdnumber, String tcFatcataxresidence, String tcCountryofbirth, String tcCityofbirth, Int64 tnAnnualincome, Int64 tnNetworth, String tdNetworth, String tcDeviceinfo, Int32 tnUpdateKYC, Int32 tnUpdateaddress, Int32 tnUpadateFatca, Int32 tnUpdateMobile, Int32 tnUpdateemail, Int32 tnUpdateBank, Int32 tnUpdateDemat, String tcUserid, String tcFatherHusbandflag, String tpDocimageforAddress, String tpDocimageforKYC, String tpDocimageforFatca, String tcBankdetails, String tpDocimageforBank, String tcDematdetails, String tpDocimageforDemat, String tcOccupation, String tcEsigneddoneby, Int64& tnEkycDocumentno, String tcFilepath, String tcAddressasperKyc, Int64 tnEkycreferenceno, String tcUseraction, String tcIdentifier, String tcEsignPdffilename, String& tceSigndocumentid, Cliole loCCMcon, String tcEsignmethod, String tcEmailFamily, String tcEconfirmation, String tcMobilefamily, Int32 tnUpdateOtherdetails, String tdDOB, String tcAadharnumber, String tceducation, String tcInternettradingflag, String tcDPfees, String tcIBTdetails, String tcIPVproofdetails, String tcDepository, Int32 tnInternetsoftware, String tcKRAAddressIPV, Boolean tlEsignwithClientname, Int32 tnUpdatenominee, String tcNomineedetails, String tcNomineeproof, String tcClientSignaturefile, String tcNomineeopted, String tcNomineeoptout, Int32 tnUpdateSegment, String tcSegmentActivationdetails, String tcSegmentDeActivationdetails, String tcSegmentproofdetails, String tcSchemecode, String tcEsigncoordinator, String tcsubcategoryforcomm, String tcCommodiyitemlist, String tcDerConsentgiven) in File25:line 71822 Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 742707200 Shut down : N Username : MOBBO Date/Time : 17/05/2024 11:02:19 AM Connection : Closed =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKVA3202Image170524110152.png$N$~ Message : UpdateEkycdata StackTrace : tpDocimageforBank Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 754278400 Shut down : N Username : MOBBO Date/Time : 17/05/2024 11:02:33 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKVA3202Image170524110152.png$N$ Message : UpdateEkycdata StackTrace : lcDocsrtring[i] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 754278400 Shut down : N Username : MOBBO Date/Time : 17/05/2024 11:02:33 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKVA3202Image170524110152.png Message : UpdateEkycdata StackTrace : lcProoffile[0] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 754278400 Shut down : N Username : MOBBO Date/Time : 17/05/2024 11:02:33 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKSIS0055PDF170524110138.pdf$N$~ Message : UpdateEkycdata StackTrace : tpDocimageforBank Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 591433728 Shut down : N Username : MOBBO Date/Time : 17/05/2024 11:03:58 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKSIS0055PDF170524110138.pdf$N$ Message : UpdateEkycdata StackTrace : lcDocsrtring[i] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 591450112 Shut down : N Username : MOBBO Date/Time : 17/05/2024 11:03:58 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKSIS0055PDF170524110138.pdf Message : UpdateEkycdata StackTrace : lcProoffile[0] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 591450112 Shut down : N Username : MOBBO Date/Time : 17/05/2024 11:03:58 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : Message : UpdateEkycdata StackTrace : tpDocimageforBank Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 790740992 Shut down : N Username : MOBBO Date/Time : 17/05/2024 11:09:55 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKR6120100Image170524111013.png$N$~ Message : UpdateEkycdata StackTrace : tpDocimageforBank Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 852979712 Shut down : N Username : MOBBO Date/Time : 17/05/2024 11:10:32 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKR6120100Image170524111013.png$N$ Message : UpdateEkycdata StackTrace : lcDocsrtring[i] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 852979712 Shut down : N Username : MOBBO Date/Time : 17/05/2024 11:10:32 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKR6120100Image170524111013.png Message : UpdateEkycdata StackTrace : lcProoffile[0] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 852979712 Shut down : N Username : MOBBO Date/Time : 17/05/2024 11:10:32 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKA1130657Image170524111256.png$N$~ Message : UpdateEkycdata StackTrace : tpDocimageforBank Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 408055808 Shut down : N Username : MOBBO Date/Time : 17/05/2024 11:13:17 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKA1130657Image170524111256.png$N$ Message : UpdateEkycdata StackTrace : lcDocsrtring[i] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 408072192 Shut down : N Username : MOBBO Date/Time : 17/05/2024 11:13:17 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKA1130657Image170524111256.png Message : UpdateEkycdata StackTrace : lcProoffile[0] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 408072192 Shut down : N Username : MOBBO Date/Time : 17/05/2024 11:13:17 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKA2132822Image170524111711.png$N$~ Message : UpdateEkycdata StackTrace : tpDocimageforBank Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 808562688 Shut down : N Username : MOBBO Date/Time : 17/05/2024 11:17:25 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKA2132822Image170524111711.png$N$ Message : UpdateEkycdata StackTrace : lcDocsrtring[i] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 808562688 Shut down : N Username : MOBBO Date/Time : 17/05/2024 11:17:25 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKA2132822Image170524111711.png Message : UpdateEkycdata StackTrace : lcProoffile[0] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 808562688 Shut down : N Username : MOBBO Date/Time : 17/05/2024 11:17:25 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKA2132822Image170524111711.png$N$~ Message : UpdateEkycdata StackTrace : tpDocimageforBank Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 856379392 Shut down : N Username : MOBBO Date/Time : 17/05/2024 11:19:03 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKA2132822Image170524111711.png$N$ Message : UpdateEkycdata StackTrace : lcDocsrtring[i] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 856379392 Shut down : N Username : MOBBO Date/Time : 17/05/2024 11:19:03 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKA2132822Image170524111711.png Message : UpdateEkycdata StackTrace : lcProoffile[0] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 856379392 Shut down : N Username : MOBBO Date/Time : 17/05/2024 11:19:03 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Select tblFirmcreation.cshortname as cShortname From tblFirmcreation tblFirmcreation Where tblFirmcreation.cUserFirmcode='NBS-000001' Title : 01~Error Description : Value cannot be null. Parameter name: dataTable Method : AgeingacrossyearLine : 46316 Message : Ageingacrossyear StackTrace : at System.Data.Common.DataAdapter.Fill(DataTable[] dataTables, IDataReader dataReader, Int32 startRecord, Int32 maxRecords) at Oracle.ManagedDataAccess.Client.OracleDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable) at clientlevel.Thinclientlevel.Clientlogin.Ageingacrossyear(DateTime tdTransactiondate, Int32 tnTotaldays1, Int32 tnTotaldays2, Int32 tnTotaldays3, Int32 tnAngleselection, Int32 tnTotaldays4, Int32 tnTotaldays5, Int32 tnTotaldays6, Cliole loLdcommon, Int32 tnTotaldays7, Int32 tnTotaldays8, Int32 tnTotaldays9, Int32 tnTotaldays10, Int32 tnTotaldays11, Int32 tnTotaldays12, Int32 tnIncludepreviousyear, Int32 tnIgnorebounced, Int32 tnonlyReconciledentries, Int32 tnTerminalcodejoin, String& tcCashpayindate, String& tcFopayindate, Int32 tnAgeingonTransactiondate, String tcClientcode, Double tnAmount, String& tcSebiageingdate) in File25:line 46316 Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 650903552 Shut down : N Username : MOBBO Date/Time : 17/05/2024 11:25:14 AM Connection : Closed =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : Message : UpdateEkycdata StackTrace : tpDocimageforBank Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 377700352 Shut down : N Username : MOBBO Date/Time : 17/05/2024 11:33:17 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : Message : UpdateEkycdata StackTrace : tpDocimageforBank Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 798687232 Shut down : N Username : MOBBO Date/Time : 17/05/2024 11:36:57 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : E0060180 With tbltempReport as (Select '01' as cRowindicator, 'Opening Market Value' as cRowdesc From Dual Union All Select '02' as cRowindicator, 'Capital In(+)/Out(-)' as cRowdesc From Dual Union All Select '03' as cRowindicator, Rpad(' ',8)||'Realized Profit (+)/(-)' as cRowdesc From dual Union All Select '04' as cRowindicator, 'Cash Segment' as cRowdesc From dual Union All Select '05' as cRowindicator, 'Derivatives Segment' as cRowdesc From dual Union All Select '06' as cRowindicator, 'Total Realized Profit(+)/(-) ' as cRowdesc From dual Union All Select '07' as cRowindicator, Rpad(' ',8)||'Un-Realized Profit (+)/(-) ' as cRowdesc From dual Union All Select '08' as cRowindicator, 'Cash Segment' as cRowdesc From dual Union All Select '09' as cRowindicator, 'Derivatives Segment' as cRowdesc From dual Union All Select '10' as cRowindicator, 'Total Un-Realized Profit(+)/(-) ' as cRowdesc From dual Union All Select '11' as cRowindicator, 'Total Dividend Amount' as cRowdesc From dual Union All Select '12' as cRowindicator, Rpad(' ',8)||'Statutory Charges' as cRowdesc From dual Union All Select '13' as cRowindicator, 'Cash Segment' as cRowdesc From dual Union All Select '14' as cRowindicator, 'Derivatives Segment' as cRowdesc From dual Union All Select '15' as cRowindicator, 'Misc. JV Entries' as cRowdesc From dual Union All Select '16' as cRowindicator, 'Direct Dividend Credit' as cRowdesc From dual Union All Select '17' as cRowindicator, 'Total Portfolio Allocation' as cRowdesc From dual Union All Select '18' as cRowindicator, 'Total No. of Days' as cRowdesc From dual Union All Select '19' as cRowindicator, 'Absolute Return' as cRowdesc From dual Union All Select '20' as cRowindicator, 'Annualized Return' as cRowdesc From dual Union All Select '24' as cRowindicator, Rpad(' ',8)||'Portfolio Allocation' as cRowdesc From dual Union All Select '25' as cRowindicator, 'Equity' as cRowdesc From dual Union All Select '26' as cRowindicator, 'Cash and Equivalent' as cRowdesc From dual Union All Select '27' as cRowindicator, 'Total Portfolio Allocation' as cRowdesc From dual ), tblReportdesc as (Select Ldfibs.Oowncode as cClientcode, tbltempReport.* From Ldfibs Ldfibs Left Outer Join tbltempReport On 1=1 Where Ldfibs.Firmnumber='NBS-000001' and (Ldfibs.Oowncode='E0060180') and Ldfibs.Brcode='W568' ), tblOpendet as (Select Ledger.Oowncode as cClientcode, '01' as cRowindicator, Sum(Ledger.Damount-Ledger.Camount)*-1 as nSecamount From Ledger Ledger Where Ledger.Firmnumber='NBS-000001' and Ledger.nFinancialyear=2024 and (Ledger.Oowncode='E0060180') and Ledger.Branchcode='W568' and Substr(Ledger.Voucher,1,4)='OPNG' group by Ledger.Oowncode Union All Select Sauda.Oowncode as cClientcode, '01' as cRowindicator, Sum(Sauda.Quantity*Sauda.Market) as nSecamount From Sauda Sauda Where Sauda.Egroup='OK' and Sauda.Firmnumber = 'NBS-000001' and (Sauda.Oowncode='E0060180') and Sauda.Brcode='W568' group by Sauda.Oowncode ), tblOpenstk as (Select tblOpendet.cClientcode as cClientcode, Max(tblOpendet.cRowindicator) as cRowindicator, 0 as nFiramount, Sum(tblOpendet.nSecamount) as nSecamount From tblOpendet tblOpendet group by tblOpendet.cClientcode), tblCapinout as (Select Ledger.Oowncode as cClientcode, '02' as cRowindicator, 0 as nFiramount, Sum(Ledger.Damount-Ledger.Camount)*-1 as nSecamount From Ledger Ledger Where Ledger.Firmnumber='NBS-000001' and Ledger.nFinancialyear=2024 and (Ledger.Oowncode='E0060180') and Ledger.Branchcode='W568' and Ledger.Dtoftran>=to_date('01/04/2023','dd/mm/yyyy') and Ledger.Dtoftran<=to_date('31/03/2024','dd/mm/yyyy') and (Substr(Ledger.Voucher,1,2)='RE' or Substr(Ledger.Voucher,1,2)='PY') group by Ledger.Oowncode ), tblFinledger as (Select Ledger.Oowncode as cClientcode, '26' as cRowindicator, Sum(Ledger.Damount-Ledger.Camount)*-1 as nFiramount, 0 as nSecamount From Ledger Ledger Where Ledger.Firmnumber='NBS-000001' and Ledger.nFinancialyear=2024 and (Ledger.Oowncode='E0060180') and Ledger.Branchcode='W568' and Ledger.Dtoftran>=to_date('01/04/2023','dd/mm/yyyy') and Ledger.Dtoftran<=to_date('31/03/2024','dd/mm/yyyy') group by Ledger.Oowncode ), tblCashinternal as (Select Sauda.Oowncode as cClientcode, Sauda.Compcode as cScripcode, Sauda.Dtoftran as dBuydate, Sauda.BuySell as cBuysell, Sum(Sauda.Quantity) as nBuyquantity, Case When Sum(Sauda.Brokpercontract) = 0 Then Avg(Sauda.Final_Rat1) Else Case When Sauda.BuySell = 'B' Then Round(((Sum(Sauda.Quantity) * Avg(Sauda.Final_Rat1)) + Sum(Sauda.Brokpercontract)) / Sum(Sauda.Quantity), 10) Else Round(((Sum(Sauda.Quantity) * Avg(Sauda.Final_Rat1)) - Sum(Sauda.Brokpercontract)) / Sum(Sauda.Quantity), 10) End End as nBuynetrate, Sum(Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, Sauda.Quantity * -1))) Over(Partition By Sauda.Oowncode, Sauda.Compcode Order By Sauda.Dtoftran, Sauda.Final_Rat1 rows between current row and unbounded following) as nRunningqty, Sum(Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, 0))) Over(Partition By Sauda.Oowncode, Sauda.Compcode Order By Sauda.Dtoftran, Sauda.Final_Rat1 rows between current row and unbounded following) as nRunningbuytotal, Sum(Sum(Decode(Sauda.Buysell, 'S', Sauda.Quantity, 0))) Over(Partition By Sauda.Oowncode, Sauda.Compcode Order By Sauda.Dtoftran, Sauda.Final_Rat1 rows between current row and unbounded following) as nRunningselltotal, Sum(Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, 0))) Over(Partition By Sauda.Oowncode, Sauda.Compcode) as nSummarybuy, Sum(Sum(Decode(Sauda.Buysell, 'S', Sauda.Quantity, 0))) Over(Partition By Sauda.Oowncode, Sauda.Compcode) as nSummarysell, Sum(Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, 0)) * Case When Sum(Sauda.Brokpercontract) = 0 Then Avg(Sauda.Final_Rat1) Else Case When Sauda.BuySell = 'B' Then Round(((Sum(Sauda.Quantity) * Avg(Sauda.Final_Rat1)) + Sum(Sauda.Brokpercontract)) / Sum(Sauda.Quantity), 10) Else 0 End End) Over(Partition By Sauda.Oowncode, Sauda.Compcode) as nSumBuyamount, Sum(Sum(Decode(Sauda.Buysell, 'S', Sauda.Quantity, 0)) * Case When Sum(Sauda.Brokpercontract) = 0 Then Avg(Sauda.Final_Rat1) Else Case When Sauda.BuySell = 'B' Then 0 Else Round(((Sum(Sauda.Quantity) * Avg(Sauda.Final_Rat1)) - Sum(Sauda.Brokpercontract)) / Sum(Sauda.Quantity), 10) End End) Over(Partition By Sauda.Oowncode, Sauda.Compcode) as nSumSellamount, Sum(Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, Sauda.Quantity * -1))) Over(Partition By Sauda.Oowncode, Sauda.Compcode) As nNetquantity From Sauda Sauda Where Sauda.Firmnumber='NBS-000001' and Sauda.Egroup!='YC' and Sauda.Egroup != 'LB' and Sauda.Egroup != 'SR' and Sauda.Egroup != 'LA' and Sauda.Sterminal != '99999' and Sauda.Dtoftran 0 Then Case When tblCashinternal.nRunningbuytotal > tblCashinternal.nNetquantity Then tblCashinternal.nNetquantity + tblCashinternal.nBuyquantity - tblCashinternal.nRunningbuytotal Else tblCashinternal.nBuyquantity End When tblCashinternal.nNetquantity < 0 Then Case When Abs(tblCashinternal.nRunningselltotal) > Abs(tblCashinternal.nNetquantity) Then tblCashinternal.nNetquantity - tblCashinternal.nBuyquantity + tblCashinternal.nRunningselltotal Else tblCashinternal.nBuyquantity * -1 End End) as nOpStockquantity, Sum((Case When tblCashinternal.nNetquantity = 0 Then 0 When tblCashinternal.nNetquantity > 0 Then Case When tblCashinternal.nRunningbuytotal > tblCashinternal.nNetquantity Then tblCashinternal.nNetquantity + tblCashinternal.nBuyquantity - tblCashinternal.nRunningbuytotal Else tblCashinternal.nBuyquantity End When tblCashinternal.nNetquantity < 0 Then Case When Abs(tblCashinternal.nRunningselltotal) > Abs(tblCashinternal.nNetquantity) Then tblCashinternal.nNetquantity - tblCashinternal.nBuyquantity + tblCashinternal.nRunningselltotal Else tblCashinternal.nBuyquantity * -1 End End) * tblCashinternal.nBuynetrate) as nOpStockAmount from tblCashinternal Where (tblCashinternal.nNetquantity > 0 And tblCashinternal.cBuysell = 'B' And tblCashinternal.nRunningbuytotal <= tblCashinternal.nNetquantity + tblCashinternal.nBuyquantity) or (tblCashinternal.nNetquantity < 0 and tblCashinternal.cBuysell = 'S' and Abs(tblCashinternal.nRunningselltotal) <= Abs(tblCashinternal.nNetquantity) + tblCashinternal.nBuyquantity) Group By tblCashinternal.cClientcode, tblCashinternal.cScripcode), tblCashinternal1 as (Select Sauda.Oowncode as cClientcode, Sauda.Compcode as cScripcode, Sauda.Dtoftran as dBuydate, Sauda.BuySell as cBuysell, Sum(Sauda.Quantity) as nBuyquantity, Case When Sum(Sauda.Brokpercontract) = 0 Then Avg(Sauda.Final_Rat1) Else Case When Sauda.BuySell = 'B' Then Round(((Sum(Sauda.Quantity) * Avg(Sauda.Final_Rat1)) + Sum(Sauda.Brokpercontract)) / Sum(Sauda.Quantity), 10) Else Round(((Sum(Sauda.Quantity) * Avg(Sauda.Final_Rat1)) - Sum(Sauda.Brokpercontract)) / Sum(Sauda.Quantity), 10) End End as nBuynetrate, Sum(Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, Sauda.Quantity * -1))) Over(Partition By Sauda.Oowncode, Sauda.Compcode Order By Sauda.Dtoftran, Sauda.Final_Rat1 rows between current row and unbounded following) as nRunningqty, Sum(Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, 0))) Over(Partition By Sauda.Oowncode, Sauda.Compcode Order By Sauda.Dtoftran, Sauda.Final_Rat1 rows between current row and unbounded following) as nRunningbuytotal, Sum(Sum(Decode(Sauda.Buysell, 'S', Sauda.Quantity, 0))) Over(Partition By Sauda.Oowncode, Sauda.Compcode Order By Sauda.Dtoftran, Sauda.Final_Rat1 rows between current row and unbounded following) as nRunningselltotal, Sum(Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, 0))) Over(Partition By Sauda.Oowncode, Sauda.Compcode) as nSummarybuy, Sum(Sum(Decode(Sauda.Buysell, 'S', Sauda.Quantity, 0))) Over(Partition By Sauda.Oowncode, Sauda.Compcode) as nSummarysell, Sum(Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, 0)) * Case When Sum(Sauda.Brokpercontract) = 0 Then Avg(Sauda.Final_Rat1) Else Case When Sauda.BuySell = 'B' Then Round(((Sum(Sauda.Quantity) * Avg(Sauda.Final_Rat1)) + Sum(Sauda.Brokpercontract)) / Sum(Sauda.Quantity), 10) Else 0 End End) Over(Partition By Sauda.Oowncode, Sauda.Compcode) as nSumBuyamount, Sum(Sum(Decode(Sauda.Buysell, 'S', Sauda.Quantity, 0)) * Case When Sum(Sauda.Brokpercontract) = 0 Then Avg(Sauda.Final_Rat1) Else Case When Sauda.BuySell = 'B' Then 0 Else Round(((Sum(Sauda.Quantity) * Avg(Sauda.Final_Rat1)) - Sum(Sauda.Brokpercontract)) / Sum(Sauda.Quantity), 10) End End) Over(Partition By Sauda.Oowncode, Sauda.Compcode) as nSumSellamount, Sum(Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, Sauda.Quantity * -1))) Over(Partition By Sauda.Oowncode, Sauda.Compcode) As nNetquantity From Sauda Sauda Where Sauda.Firmnumber='NBS-000001' and Sauda.Egroup!='YC' and Sauda.Egroup != 'LB' and Sauda.Egroup != 'SR' and Sauda.Egroup != 'LA' and Sauda.Sterminal != '99999' and Sauda.Dtoftran<=to_date('31/03/2024','dd/mm/yyyy') and Sauda.Brcode='W568' and (Sauda.Oowncode='E0060180') group by Sauda.Oowncode, Sauda.Dtoftran, Sauda.Final_Rat1, Sauda.buysell, Sauda.Compcode), tblClosing as (Select tblCashinternal1.cClientcode as cClientcode, tblCashinternal1.cScripcode as cScripcode, Sum(Case When tblCashinternal1.nNetquantity = 0 Then 0 When tblCashinternal1.nNetquantity > 0 Then Case When tblCashinternal1.nRunningbuytotal > tblCashinternal1.nNetquantity Then tblCashinternal1.nNetquantity + tblCashinternal1.nBuyquantity - tblCashinternal1.nRunningbuytotal Else tblCashinternal1.nBuyquantity End When tblCashinternal1.nNetquantity < 0 Then Case When Abs(tblCashinternal1.nRunningselltotal) > Abs(tblCashinternal1.nNetquantity) Then tblCashinternal1.nNetquantity - tblCashinternal1.nBuyquantity + tblCashinternal1.nRunningselltotal Else tblCashinternal1.nBuyquantity * -1 End End) AS nCLStockquantity, Sum((Case When tblCashinternal1.nNetquantity = 0 Then 0 When tblCashinternal1.nNetquantity > 0 Then Case When tblCashinternal1.nRunningbuytotal > tblCashinternal1.nNetquantity Then tblCashinternal1.nNetquantity + tblCashinternal1.nBuyquantity - tblCashinternal1.nRunningbuytotal Else tblCashinternal1.nBuyquantity End When tblCashinternal1.nNetquantity < 0 Then Case When Abs(tblCashinternal1.nRunningselltotal) > Abs(tblCashinternal1.nNetquantity) Then tblCashinternal1.nNetquantity - tblCashinternal1.nBuyquantity + tblCashinternal1.nRunningselltotal Else tblCashinternal1.nBuyquantity * -1 End End) * tblCashinternal1.nBuynetrate) as nClStockAmount from tblCashinternal1 Where (tblCashinternal1.nNetquantity > 0 And tblCashinternal1.cBuysell = 'B' And tblCashinternal1.nRunningbuytotal <= tblCashinternal1.nNetquantity + tblCashinternal1.nBuyquantity) or (tblCashinternal1.nNetquantity < 0 and tblCashinternal1.cBuysell = 'S' and Abs(tblCashinternal1.nRunningselltotal) <= Abs(tblCashinternal1.nNetquantity) + tblCashinternal1.nBuyquantity) Group By tblCashinternal1.cClientcode, tblCashinternal1.cScripcode), tblBuYSell as (Select Sauda.Oowncode as cClientcode, Sauda.Compcode as cScripcode, Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, 0)) as nbuyQty, Sum(Decode(Sauda.Buysell, 'S', Sauda.Quantity, 0)) as nsellQty, Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity * Sauda.Final_Rat1 , 0)+Case When Sauda.Buysell='B' then Sauda.Brokpercontract else 0 end) as nBuyamount, Sum(Decode(Sauda.Buysell, 'S', Sauda.Quantity * Sauda.Final_Rat1 , 0)-Case When Sauda.Buysell='S' then Sauda.Brokpercontract else 0 end) as nSellamount From Sauda Sauda Where Sauda.Firmnumber='NBS-000001' and Sauda.Egroup!='YC' and Sauda.Egroup != 'LB' and Sauda.Egroup != 'SR' and Sauda.Egroup != 'LA' and Sauda.Sterminal != '99999' and Sauda.Dtoftran>=to_date('01/04/2023','dd/mm/yyyy') and Sauda.Dtoftran<=to_Date('31/03/2024','dd/mm/yyyy') and Sauda.Brcode='W568' and (Sauda.Oowncode='E0060180') group by Sauda.Oowncode, Sauda.Compcode), tblCashcost as (Select Coalesce(tblOpening.cClientcode,tblClosing.cClientcode,tblBuysell.cClientcode) as cClientcode, Coalesce(tblOpening.cScripcode,tblClosing.cScripcode,tblBuysell.cScripcode) as cScripcode, Nvl(tblOpening.nOpstockquantity,0) as nOpstockquantity, Nvl(tblOpening.nOpstockamount,0) as nOpstockamount, Case When Nvl(tblOpening.nOpstockquantity,0)!=0 then Round(Nvl(tblOpening.nOpstockamount,0)/Nvl(tblOpening.nOpstockquantity,0),4) else 0 end as nOpstockavg, Nvl(tblBuysell.nBuyqty,0) as nPrePurchqty, Nvl(tblBuysell.nBuyamount,0) as nPrePurchvalue, Case When Nvl(tblBuysell.nBuyqty,0) !=0 then Round(Nvl(tblBuysell.nBuyamount,0)/Nvl(tblBuysell.nBuyqty,0),4) else 0 end as nPrePurchavg, Nvl(tblBuysell.nSellQty, 0) as nPreSellqty, Nvl(tblBuysell.nSellamount, 0) as nPreSellvalue, Case When Nvl(tblBuysell.nSellQty, 0) != 0 then Round(Nvl(tblBuysell.nSellamount, 0) / Nvl(tblBuysell.nSellQty, 0), 4) else 0 end as nPreSellavg, Least((Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockquantity, 0) + Nvl(tblBuysell.nBuyqty, 0) Else Nvl(tblBuysell.nBuyqty, 0) End), (Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockquantity, 0)) + Nvl(tblBuysell.nSellqty, 0) Else Nvl(tblBuysell.nSellqty, 0) End)) as nPurchqty, Round((Case When (Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockquantity, 0) + Nvl(tblBuysell.nBuyqty, 0) Else Nvl(tblBuysell.nBuyqty, 0) End) <= (Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockquantity, 0)) + Nvl(tblBuysell.nSellqty, 0) Else Nvl(tblBuysell.nSellqty, 0) End) Then Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockAmount, 0) + Nvl(tblBuysell.nBuyAmount, 0) Else Nvl(tblBuysell.nBuyAmount, 0) End Else Nvl(tblBuysell.nBuyAmount, 0) + Nvl(tblOpening.nOpstockAmount, 0) - nvl(tblClosing.nClStockAmount, 0) End), 2) as nPurchvalue, Round((Case When Least((Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockquantity, 0) + Nvl(tblBuysell.nBuyqty, 0) Else Nvl(tblBuysell.nBuyqty, 0) End), (Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockquantity, 0)) + Nvl(tblBuysell.nSellqty, 0) Else Nvl(tblBuysell.nSellqty, 0) End)) != 0 Then (Case When (Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockquantity, 0) + Nvl(tblBuysell.nBuyqty, 0) Else Nvl(tblBuysell.nBuyqty, 0) End) <= (Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockquantity, 0)) + Nvl(tblBuysell.nSellqty, 0) Else Nvl(tblBuysell.nSellqty, 0) End) Then Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockAmount, 0) + Nvl(tblBuysell.nBuyAmount, 0) Else Nvl(tblBuysell.nBuyAmount, 0) End Else Nvl(tblBuysell.nBuyAmount, 0) + Nvl(tblOpening.nOpstockAmount, 0) - nvl(tblClosing.nClStockAmount, 0) End) / (Least((Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockquantity, 0) + Nvl(tblBuysell.nBuyqty, 0) Else Nvl(tblBuysell.nBuyqty, 0) End), (Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockquantity, 0)) + Nvl(tblBuysell.nSellqty, 0) Else Nvl(tblBuysell.nSellqty, 0) End))) Else 0 End), 4) as nPurchavg, Least((Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockquantity, 0) + Nvl(tblBuysell.nBuyqty, 0) Else Nvl(tblBuysell.nBuyqty, 0) End), (Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockquantity, 0)) + Nvl(tblBuysell.nSellqty, 0) Else Nvl(tblBuysell.nSellqty, 0) End)) as nSalesqty, Round((Case When (Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockquantity, 0) + Nvl(tblBuysell.nBuyqty, 0) Else Nvl(tblBuysell.nBuyqty, 0) End) >= (Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockquantity, 0)) + Nvl(tblBuysell.nSellqty, 0) Else Nvl(tblBuysell.nSellqty, 0) End) Then Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockAmount, 0)) + Nvl(tblBuysell.nSellAmount, 0) Else Nvl(tblBuysell.nSellAmount, 0) End Else Nvl(tblBuysell.nSellAmount, 0) - Nvl(tblOpening.nOpstockAmount, 0) + nvl(tblClosing.nClStockAmount, 0) End), 2) as nSalesvalue, Round((Case When Least((Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockquantity, 0) + Nvl(tblBuysell.nBuyqty, 0) Else Nvl(tblBuysell.nBuyqty, 0) End), (Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockquantity, 0)) + Nvl(tblBuysell.nSellqty, 0) Else Nvl(tblBuysell.nSellqty, 0) End)) != 0 Then (Case When (Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockquantity, 0) + Nvl(tblBuysell.nBuyqty, 0) Else Nvl(tblBuysell.nBuyqty, 0) End) >= (Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockquantity, 0)) + Nvl(tblBuysell.nSellqty, 0) Else Nvl(tblBuysell.nSellqty, 0) End) Then Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockAmount, 0)) + Nvl(tblBuysell.nSellAmount, 0) Else Nvl(tblBuysell.nSellAmount, 0) End Else Nvl(tblBuysell.nSellAmount, 0) - Nvl(tblOpening.nOpstockAmount, 0) + nvl(tblClosing.nClStockAmount, 0) End) / (Least((Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockquantity, 0) + Nvl(tblBuysell.nBuyqty, 0) Else Nvl(tblBuysell.nBuyqty, 0) End), (Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockquantity, 0)) + Nvl(tblBuysell.nSellqty, 0) Else Nvl(tblBuysell.nSellqty, 0) End))) ELse 0 End), 4) as nSalesavg, Nvl(tblClosing.nClstockquantity, 0) as nOsstock, Nvl(tblClosing.nClstockamount, 0) as nOsstockvalue, Case When Nvl(tblClosing.nClstockquantity, 0) != 0 then Round(Nvl(tblClosing.nClstockamount, 0) / Nvl(tblClosing.nClstockquantity, 0), 4) else 0 end as nOsstockavg, (nvl(tblBuySell.nSellAmount, 0) - nvl(tblOpening.nOpStockAmount, 0) - nvl(tblBuySell.nBuyAmount, 0) + nvl(tblClosing.nClStockAmount, 0)) as nProfitloss, ((Market.Market * nvl(tblClosing.nClstockquantity, 0)) - Nvl(tblClosing.nClstockamount, 0)) As nUnrealprlo, (nvl(tblBuySell.nSellAmount, 0) - nvl(tblOpening.nOpStockAmount, 0) - nvl(tblBuySell.nBuyAmount, 0) + nvl(tblClosing.nClStockAmount, 0)) + ((Market.Market * nvl(tblClosing.nClstockquantity, 0)) - Nvl(tblClosing.nClstockamount, 0)) As nOverallprlo, Market.Market as nMarketrate, Market.Market*Nvl(tblClosing.nClstockquantity,0) As nMarketvalue from tblOPening tblOpening Full Join TblClosing on tblOpening.cclientcode = tblclosing.cclientcode and tblOPening.cScripcode = tblClosing.cScripcode Full Join TblBuySell on tblBuySell.cclientcode = coalesce(tblOpening.cclientcode, tblclosing.cclientcode) and tblBuySell.cScripcode = coalesce(tblOPening.cScripcode, tblClosing.cScripcode) Left Outer Join Market Market On Market.Firmnumber='NBS-000001' and Market.code=coalesce(tblOpening.cScripcode, tblclosing.cScripcode, tblBuysell.cScripcode) ), tblOpendet as (Select Ledger.Oowncode as cClientcode, '01' as cRowindicator, Sum(Ledger.Damount-Ledger.Camount)*-1 as nSecamount From Ledger Ledger Where Ledger.Firmnumber='NBS-000001' and Ledger.nFinancialyear = 2024 and (Ledger.Oowncode='E0060180') and Ledger.Branchcode='W568' and Substr(Ledger.Voucher,1,4)='OPNG' group by Ledger.Oowncode Union All Select tblCashcost.cClientcode as cClientcode, '01' as cRowindicator, Sum(tblCashcost.nOpstockamount) as nSecamount From tblCashcost tblCashcost group by tblCashcost.cClientcode ), tblOpenstk as (Select tblOpendet.cClientcode as cClientcode, Max(tblOpendet.cRowindicator) as cRowindicator, 0 as nFiramount, Sum(tblOpendet.nSecamount) as nSecamount From tblOpendet tblOpendet group by tblOpendet.cClientcode), tblPortcashfin as (Select tblCashcost.cClientcode as cClientcode, '04' as cRowindicator, Sum(tblCashcost.nProfitloss) as nFiramount, 0 as nSecamount From tblCashcost tblCashcost group by tblCashcost.cClientcode Union All Select tblCashcost.cClientcode as cClientcode, '25' as cRowindicator, Sum(tblCashcost.nMarketvalue) as nFiramount, 0 as nSecamount From tblCashcost tblCashcost group by tblCashcost.cClientcode Union All Select tblCashcost.cClientcode as cClientcode, '08' as cRowindicator, Sum(tblCashcost.nUnrealprlo) as nFiramount, 0 as nSecamount From tblCashcost tblCashcost group by tblCashcost.cClientcode ), tblFointernal as (Select Fosauda.Oowncode as cClientcode, Fosauda.Compcode as cScripcode, Fosauda.Strikeprice as nStrikeprice, Fosauda.Optiontype as cOptiontype, Company.Fibsacct as cScripname, Company.Expirydate as dExpirydate, Exchange.Operation as cOperation, Company.Instrutyp as cInstrutyp, Company.nBaseunit as nBaseunit, Company.cUnitofmeasurement as cUnitofmeasurement, Company.cUnitofTrading as cUnitofTrading, Company.nTradeablelot as nTradeablelot, Company.nPricenumerator as nPricenumerator, Company.nPricedenominator as nPricedenominator, Company.nGeneralnumerator as nGeneralnumerator, Company.nGeneraldenominator as nGeneraldenominator, Fosauda.Dtoftran as dBuydate, Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') or Fosauda.Optiontype != 'PO' Then Fosauda.Buysell else Case When Fosauda.Buysell = 'B' Then 'S' Else 'B' End end as cBuysell, Sum(Fosauda.quantity) as nBuyquantity, Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') Then Case When Sum(Fosauda.nValuebrokerage) = 0 then Avg(Fosauda.Final_Rat1) else Case When Fosauda.BuySell = 'B' Then Round(((Sum(Fosauda.Quantity) * Avg(Fosauda.Final_Rat1)) + Sum(Fosauda.nValuebrokerage)) / Sum(Fosauda.Quantity), 10) Else Round(((Sum(Fosauda.Quantity) * Avg(Fosauda.Final_Rat1)) - Sum(Fosauda.nValuebrokerage)) / Sum(Fosauda.Quantity), 10) End End Else Case When Fosauda.Buysell = 'B' Then Avg(Fosauda.Final_rat1) - Avg(Fosauda.Strikeprice) else Avg(Fosauda.Strikeprice) - Avg(Fosauda.Final_rat1) End End as nBuynetrate, Sum(Sum(Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') or Fosauda.Optiontype != 'PO' Then Decode(Fosauda.Buysell, 'B', Fosauda.Quantity, Fosauda.Quantity * -1) Else Decode(Fosauda.Buysell, 'S', Fosauda.Quantity, Fosauda.Quantity * -1) End)) Over(Partition By Fosauda.Oowncode, Company.Fibsacct, Fosauda.Strikeprice, Fosauda.Optiontype Order By Fosauda.Dtoftran, Fosauda.Final_Rat1 rows between current row and unbounded following) as nRunningqty, Sum(Sum(Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') or Fosauda.optiontype != 'PO' Then Decode(Fosauda.Buysell, 'B', Fosauda.Quantity, 0) Else Decode(Fosauda.Buysell, 'S', Fosauda.Quantity, 0) End)) Over(Partition By Fosauda.Oowncode, Company.Fibsacct, Fosauda.Strikeprice, Fosauda.Optiontype Order By Fosauda.Dtoftran, Fosauda.Final_Rat1 rows between current row and unbounded following) as nRunningbuytotal, Sum(Sum(Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') or Fosauda.Optiontype != 'PO' Then Decode(Fosauda.Buysell, 'S', Fosauda.Quantity, 0) Else Decode(Fosauda.Buysell, 'B', Fosauda.Quantity, 0) End)) Over(Partition By Fosauda.Oowncode, Company.Fibsacct, Fosauda.Strikeprice, Fosauda.Optiontype Order By Fosauda.Dtoftran, Fosauda.Final_Rat1 rows between current row and unbounded following) as nRunningselltotal, Sum(Sum(Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') or Fosauda.optiontype != 'PO' Then Decode(Fosauda.Buysell, 'B', Fosauda.Quantity, 0) Else Decode(Fosauda.Buysell, 'S', Fosauda.Quantity, 0) End)) Over(Partition By Fosauda.Oowncode, Company.Fibsacct, Fosauda.Strikeprice, Fosauda.Optiontype) as nSummarybuy, Sum(Sum(Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') or Fosauda.optiontype != 'PO' Then Decode(Fosauda.Buysell, 'S', Fosauda.Quantity, 0) Else Decode(Fosauda.Buysell, 'B', Fosauda.Quantity, 0) End)) Over(Partition By Fosauda.Oowncode, Company.Fibsacct, Fosauda.Strikeprice, Fosauda.Optiontype) as nSummarysell, Sum(Sum(Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') or Fosauda.Optiontype != 'PO' Then Decode(Fosauda.Buysell, 'B', Fosauda.Quantity, 0) Else Decode(Fosauda.Buysell, 'S', Fosauda.Quantity, 0) End) * Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') Then Case When Sum(Fosauda.nValuebrokerage) = 0 then Avg(Fosauda.Final_Rat1) else Case When Fosauda.BuySell = 'B' Then Round(((Sum(Fosauda.Quantity) * Avg(Fosauda.Final_Rat1)) + Sum(Fosauda.nValuebrokerage)) / Sum(Fosauda.Quantity), 10) Else Round(((Sum(Fosauda.Quantity) * Avg(Fosauda.Final_Rat1)) - Sum(Fosauda.nValuebrokerage)) / Sum(Fosauda.Quantity), 10) End End Else Abs(Avg(Fosauda.Final_Rat1) - Avg(fosauda.strikeprice)) End) Over(Partition By Fosauda.Oowncode, Company.Fibsacct, Fosauda.Strikeprice, Fosauda.Optiontype) as nSumBuyamount, Sum(Sum(Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') or Fosauda.Optiontype != 'PO' Then Decode(Fosauda.Buysell, 'S', Fosauda.Quantity, 0) Else Decode(Fosauda.Buysell, 'B', Fosauda.Quantity, 0) End) * Case When (Fosauda.saudatype != 'AS' and Fosauda.Saudatype != 'EX') Then Case When Sum(Fosauda.nValuebrokerage) = 0 then Avg(Fosauda.Final_Rat1) else Case When Fosauda.BuySell = 'B' Then Round(((Sum(Fosauda.Quantity) * Avg(Fosauda.Final_Rat1)) + Sum(Fosauda.nValuebrokerage)) / Sum(Fosauda.Quantity), 10) Else Round(((Sum(Fosauda.Quantity) * Avg(Fosauda.Final_Rat1)) - Sum(Fosauda.nValuebrokerage)) / Sum(Fosauda.Quantity), 10) End End Else Abs(Avg(Fosauda.Final_Rat1) - Avg(fosauda.strikeprice)) End) Over(Partition By Fosauda.Oowncode, Company.Fibsacct, Fosauda.Strikeprice, Fosauda.Optiontype) as nSumSellamount, Sum(Sum(Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') or Fosauda.optiontype != 'PO' Then Decode(Fosauda.Buysell, 'B', Fosauda.Quantity, Fosauda.Quantity * -1) Else Decode(Fosauda.Buysell, 'S', Fosauda.Quantity, Fosauda.Quantity * -1) End)) Over(Partition By Fosauda.Oowncode, Company.Fibsacct, Fosauda.Strikeprice, Fosauda.Optiontype) As nNetquantity From Fosauda Fosauda Inner Join Company Company On Fosauda.firmnumber = Company.Firmnumber and Fosauda.Compcode = Company.oowncode Inner Join Exchange Exchange On Fosauda.Firmnumber = Exchange.Firmnumber and Fosauda.Exchcode = Exchange.Code Where Fosauda.Firmnumber = 'NBS-000001' and Fosauda.Egroup != 'YF' and Fosauda.Egroup != 'LB' and Fosauda.Egroup != 'SR' and Fosauda.Egroup != 'LA' and Fosauda.Sterminal != '99999' and (Fosauda.Oowncode='E0060180') and Fosauda.Brcode='W568' and Fosauda.Dtoftran>=to_date('01/04/2023','dd/mm/yyyy') and Fosauda.Dtoftran<=to_date('31/03/2024','dd/mm/yyyy') and ((Fosauda.Saudatype != 'B/' and Fosauda.Orignalno = 0) or (Fosauda.Saudatype = 'B/' and (Fosauda.Orignalno = -99 or Fosauda.Dtoftran=to_date('01/04/2023','dd/mm/yyyy')))) group by Fosauda.Oowncode, Company.Fibsacct, Company.Expirydate, Exchange.Operation, Company.Instrutyp, Company.nBaseunit, Company.cUnitofmeasurement, Company.cUnitofTrading, Company.nTradeablelot, Company.nPricenumerator, Company.nPricedenominator, Company.nGeneralnumerator, Company.nGeneraldenominator, Fosauda.Dtoftran, Fosauda.Final_Rat1, Fosauda.buysell, Fosauda.Compcode, Fosauda.Strikeprice, Fosauda.Saudatype, Fosauda.Optiontype), tblFocost as (Select tblFointernal.cClientcode as cClientcode, tblFointernal.cScripcode as cScripcode, tblFointernal.nStrikeprice as nStrikeprice, tblFointernal.cOptiontype as cOptiontype, tblFointernal.cScripname as cScripname, tblFointernal.cOperation as cOperation, tblFoInternal.cInstrutyp as cInstrutyp, tblFoInternal.nBaseunit as nBaseunit, tblFoInternal.cUnitofmeasurement as cUnitofmeasurement, tblFoInternal.cUnitofTrading as cUnitofTrading, tblFoInternal.nTradeablelot as nTradeablelot, tblFoInternal.nPricenumerator as nPricenumerator, tblFoInternal.nPricedenominator as nPricedenominator, tblFoInternal.nGeneralnumerator as nGeneralnumerator, tblFoInternal.nGeneraldenominator as nGeneraldenominator, tblFointernal.dExpirydate as dExpirydate, tblFointernal.dBuydate as dBuydate, tblFointernal.nBuynetrate as nBuynetrate, Case When tblFointernal.nNetquantity = 0 Then 0 When tblFointernal.nNetquantity > 0 Then Case When tblFointernal.nRunningbuytotal > tblFointernal.nNetquantity Then tblFointernal.nNetquantity + tblFointernal.nBuyquantity - tblFointernal.nRunningbuytotal Else tblFointernal.nBuyquantity End When tblFointernal.nNetquantity < 0 Then Case When abs(tblFointernal.nRunningselltotal) > abs(tblFointernal.nNetquantity) Then tblFointernal.nNetquantity - tblFointernal.nBuyquantity + tblFointernal.nRunningselltotal Else tblFointernal.nBuyquantity * -1 End End AS nStockquantity, tblFointernal.nSummarybuy as nSummarybuy, tblFointernal.nSumBuyamount as nSumbuyamount, tblFointernal.nSummarysell as nSummarysell, tblFointernal.nSumSellamount as nSumsellamount From tblFointernal tblFoInternal Where (tblFointernal.nNetquantity > 0 and tblFointernal.cBuysell = 'B' and tblFointernal.nRunningbuytotal <= tblFointernal.nNetquantity + tblFointernal.nBuyquantity) or (tblFointernal.nNetquantity < 0 and tblFointernal.cBuysell = 'S' and abs(tblFointernal.nRunningselltotal) <= Abs(tblFointernal.nNetquantity) + tblFointernal.nBuyquantity) or (tblFointernal.nNetquantity = 0 And tblFointernal.nRunningselltotal = tblFointernal.nSummarysell and tblFointernal.nRunningbuytotal = tblFointernal.nSummarybuy)), tblFinalcost as (Select tblFocost.cClientcode as cClientcode, tblFocost.cScripcode as cScripcode, tblFocost.nStrikeprice as nStrikeprice, tblFocost.cOptiontype as cOptiontype, tblFocost.dExpirydate as dExpirydate, tblFocost.cScripname as cScripname, tblFocost.cOperation as cOperation, tblFocost.cInstrutyp as cInstrutyp, tblFocost.nBaseunit as nBaseunit, tblFocost.cUnitofmeasurement as cUnitofmeasurement, tblFocost.cUnitofTrading as cUnitofTrading, tblFocost.nTradeablelot as nTradeablelot, tblFocost.nPricenumerator as nPricenumerator, tblFocost.nPricedenominator as nPricedenominator, tblFocost.nGeneralnumerator as nGeneralnumerator, tblFocost.nGeneraldenominator as nGeneraldenominator, tblFocost.nSummarybuy - (Case When Sum(tblFocost.nStockquantity) > 0 then Sum(tblFocost.nStockquantity) else 0 end) As nPurchqty, tblFocost.nSumbuyamount - (Case When Sum(tblFocost.nStockquantity) > 0 then Sum(tblFocost.nStockquantity * tblFocost.nBuyNetRate) else 0 end) As nPurchvalue, tblFocost.nSummarysell - (Case When Sum(tblFocost.nStockquantity) < 0 then Sum(Abs(tblFocost.nStockquantity)) else 0 end) as nSalesqty, tblFocost.nSumSellamount - (Case When Sum(tblFocost.nStockquantity) < 0 then Sum(Abs(tblFocost.nStockquantity) * tblFocost.nBuyNetRate) else 0 end) as nSalesvalue, Sum(tblFocost.nStockquantity) As nOsstock, Case When Sum(tblFocost.nStockquantity) != 0 then Round(Sum(tblFocost.nStockquantity * tblFocost.nBuyNetRate) / Sum(tblFocost.nStockquantity), 4) else 0 end as nOsstockavg, Sum(tblFocost.nStockquantity * tblFocost.nBuyNetRate) as nOsstockvalue, tblFocost.nSumSellamount + Sum(tblFocost.nStockquantity * tblFocost.nBuyNetRate) - tblFocost.nSumBuyamount as nProfitLoss, Max(Market.Market) as nMarketrate, Max(Market.Market) * Sum(tblFocost.nStockquantity) as nMarketvalue, ((tblFocost.nSumSellamount + Sum(tblFocost.nStockquantity * tblFocost.nBuyNetRate) - tblFocost.nSumBuyamount)) + ((Max(Market.Market) * Sum(tblFocost.nStockquantity)) - (Sum(tblFocost.nStockquantity * tblFocost.nBuyNetRate))) as nOverallprlo, Max(Market.nPrvcloseprice) as nPrvcloseprice, Max(Market.nHighprice) as nHighprice, Max(Market.nLowprice) as nLowprice, Max(Market.nLowercircuitLimit) as nLowercircuitlimit, Max(Market.nOpenprice) as nOpenprice, Max(Market.nUppercircuitlimit) as nUppercircuitlimit, Max(Market.nNoofTrades) as nNooftrades, Max(Market.nVoltradedToday) as nVoltradedtoday, Max(Market.nVolquantity) as nVolquantity, Max(Market.dLastupdatedate) as dlastupdatedate, Max(Market.n52Weeklow) as n52Weeklow, Max(Market.n52WeekHigh) as n52Weekhigh From tblFocost tblFocost Left Outer Join Market Market On Market.Firmnumber = 'NBS-000001' and tblFocost.cScripcode = Market.Code and tblFocost.nStrikeprice = Market.Strikeprice and tblFocost.cOptiontype = Market.Optiontype and ((Market.nOptmethod = 0 and tblFocost.nStrikeprice = 0) or (Market.nOptmethod = 1 and tblFocost.nStrikeprice != 0)) Group By tblFocost.cClientcode, tblFocost.cScripcode, tblFocost.cScripname, tblFocost.cOperation, tblFocost.cInstrutyp, tblFocost.nBaseunit, tblFocost.cUnitofmeasurement, tblFocost.cUnitofTrading, tblFocost.nTradeablelot, tblFocost.nPricenumerator, tblFocost.nPricedenominator, tblFocost.nGeneralnumerator, tblFocost.nGeneraldenominator, tblFocost.dExpirydate, tblFocost.nStrikeprice, tblFocost.cOptiontype, tblFocost.nSummarybuy, tblFocost.nSumBuyamount, tblFocost.nSummarysell, tblFocost.nSumSellamount), tblPortderfinal as (Select tblFinalcost.cClientcode as cClientcode, tblFinalcost.cScripcode as cScripcode, tblFinalcost.cScripname as cScripname, tblFinalcost.cOperation as cOperation, tblFinalcost.cInstrutyp as cInstrutyp, tblFinalcost.nBaseunit as nBaseunit, tblFinalcost.cUnitofmeasurement as cUnitofmeasurement, tblFinalcost.cUnitofTrading as cUnitofTrading, tblFinalcost.nTradeablelot as nTradeablelot, tblFinalcost.nPricenumerator as nPricenumerator, tblFinalcost.nPricedenominator as nPricedenominator, tblFinalcost.nGeneralnumerator as nGeneralnumerator, tblFinalcost.nGeneraldenominator as nGeneraldenominator, tblFinalcost.nStrikeprice as nStrikeprice, tblFinalcost.cOptiontype as cOptiontype, tblFinalcost.dExpirydate as dExpirydate, tblFinalcost.nPurchqty As nPurchqty, tblFinalcost.nPurchvalue As nPurchvalue, Round(Case When tblFinalcost.nPurchqty != 0 then tblFinalcost.nPurchvalue / tblFinalcost.nPurchqty else 0 End, 4) As nPurchavg, tblFinalcost.nSalesqty as nSalesqty, tblFinalcost.nSalesvalue as nSalesvalue, Round(Case When tblFinalcost.nSalesqty != 0 then tblFinalcost.nSalesvalue / tblFinalcost.nSalesqty else 0 end, 4) as nSalesavg, tblFinalcost.nOsstock As nOsstock, tblFinalcost.nOsstockavg as nOsstockavg, tblFinalcost.nOsstockvalue as nOsstockvalue, tblFinalcost.nMarketrate as nMarketrate, tblFinalcost.nMarketvalue as nMarketvalue, ((tblFinalcost.nMarketrate * tblFinalcost.nOsstock) - (tblFinalcost.nOsstock * tblFinalcost.nOsstockavg)) as nUnrealprlo, tblFinalcost.nProfitloss as nProfitLoss, tblFinalcost.nOverallprlo as nOverallprlo, tblFinalcost.nPrvcloseprice as nPrvcloseprice, tblFinalcost.nHighprice as nHighprice, tblFinalcost.nLowprice as nLowprice, tblFinalcost.nLowercircuitLimit as nLowercircuitlimit, tblFinalcost.nOpenprice as nOpenprice, tblFinalcost.nUppercircuitlimit as nUppercircuitlimit, tblFinalcost.nNooftrades as nNooftrades, tblFinalcost.nVoltradedtoday as nVoltradedtoday, tblFinalcost.nVolquantity as nVolquantity, tblFinalcost.dLastupdatedate as dlastupdatedate, tblFinalcost.n52WeekLow as n52Weeklow, tblFinalcost.n52Weekhigh as n52Weekhigh From tblFinalcost tblFinalcost Order by tblFinalcost.cClientcode, tblFinalcost.cScripname, tblFinalcost.nStrikeprice, tblFinalcost.cOptiontype, tblFinalcost.dExpirydate ), tblPortderfin as (Select tblPortderfinal.cClientcode as cClientcode, '05' as cRowindicator, Sum(tblPortderfinal.nProfitloss) as nFiramount, 0 as nSecamount From tblPortderfinal tblPortderfinal group by tblPortderfinal.cClientcode Union All Select tblPortderfinal.cClientcode as cClientcode, '09' as cRowindicator, Sum(tblPortderfinal.nUnrealprlo) as nFiramount, 0 as nSecamount From tblPortderfinal tblPortderfinal group by tblPortderfinal.cClientcode), tblCashplusderfinal as (Select Coalesce(tblPortcashfin.cClientcode,tblPortderfin.cClientcode) as cClientcode, Case When Coalesce(tblPortcashfin.cRowindicator,tblPortderfin.cRowindicator)='04' or Coalesce(tblPortcashfin.cRowindicator,tblPortderfin.cRowindicator)='05' then '06' else '10' end as cRowindicator, 0 as nFiramount, Sum(Coalesce(tblPortcashfin.nFiramount,tblPortderfin.nFiramount,0)) as nSecamount From tblPortcashfin Full outer join tblPortderfin On tblPortcashfin.cClientcode=tblPortderfin.cClientcode and tblPortcashfin.cRowindicator=tblPortderfin.cRowindicator Where tblPortcashfin.cRowindicator='04' or tblPortcashfin.cRowindicator='08' or tblPortderfin.cRowindicator='05' or tblPortderfin.cRowindicator='09' group by Coalesce(tblPortcashfin.cClientcode,tblPortderfin.cClientcode) , Case When Coalesce(tblPortcashfin.cRowindicator,tblPortderfin.cRowindicator)='04' or Coalesce(tblPortcashfin.cRowindicator,tblPortderfin.cRowindicator)='05' then '06' else '10' end ), tblDividend as (Select Ledger.Oowncode as cClientcode, '11' as cRowindicator, 0 as nFiramount, Sum(Ledger.damount-Ledger.Camount)*-1 as nSecamount From Ledger Ledger Inner Join Journal On Ledger.Firmnumber=Journal.Firmnumber and Ledger.Voucher=Journal.Jvnumber and Ledger.nFinancialyear=Journal.nFinancialyear Where Ledger.Firmnumber='NBS-000001' and Ledger.nFinancialyear=2024 and (Ledger.Oowncode='E0060180') and Ledger.Branchcode='W568' and Ledger.Dtoftran>=to_date('01/04/2023','dd/mm/yyyy') and Ledger.Dtoftran<=to_date('31/03/2024','dd/mm/yyyy') and Journal.nEntrytype=1 group by Ledger.Oowncode ), tblDirectDividend as (Select tblDirectdiv.cClientcode as cClientcode, '16' as cRowindicator, 0 as nFiramount, Sum(tblDirectdiv.nQuantity*tblDirectdiv.nRate)*-1 as nSecamount From tblDirectdiv tblDirectdiv Inner Join Ldfibs Ldfibs On tblDirectdiv.cFirmnumber = Ldfibs.Firmnumber and tblDirectdiv.cClientcode = Ldfibs.Oowncode Where tblDirectdiv.cFirmnumber='NBS-000001' and (tblDirectdiv.cClientcode='E0060180') and tblDirectdiv.dDtoftran>=to_date('01/04/2023','dd/mm/yyyy') and tblDirectdiv.dDtoftran<=to_date('31/03/2024','dd/mm/yyyy') group by tblDirectdiv.cClientcode ), tbltmpBillcharges as (Select Billcharges.Oowncode as cClientcode, Case When Billcharges.Egroup='FU' then '14' else '13' end as cRowindicator, Sum(Billcharges.Quantity*Billcharges.Final_Rat1) as nFiramount, 0 as nSecamount From Billcharges Billcharges Where Billcharges.Firmnumber='NBS-000001' and Billcharges.Brcode='W568' and (Billcharges.Oowncode='E0060180') and Billcharges.Dtoftran>=to_date('01/04/2023','dd/mm/yyyy') and Billcharges.Dtoftran<=to_date('31/03/2024','dd/mm/yyyy') group by Billcharges.Oowncode, Case When Billcharges.Egroup='FU' then '14' else '13' end ), tbltmpbillchgtotal as (Select tbltmpBillcharges.cClientcode as cClientcode, '12' as cRowindicator, 0 as nFiramount, Sum(tbltmpBillcharges.nFiramount) as nSecamount from tbltmpBillcharges tbltmpBillcharges group by tbltmpbillcharges.cClientcode ), tblMiscentries as ( Select Ledger.Oowncode as cClientcode, '15' as cRowindicator, 0 as nFiramount, Sum(Ledger.damount-Ledger.Camount)*-1 as nSecamount From Ledger Ledger Inner Join Journal On Ledger.Firmnumber=Journal.Firmnumber and Ledger.Voucher=Journal.Jvnumber and Ledger.nFinancialyear=Journal.nFinancialyear Where Ledger.Firmnumber='NBS-000001' and Ledger.nFinancialyear=2024 and (Ledger.Oowncode='E0060180') and Ledger.Branchcode='W568' and Ledger.Dtoftran>=to_date('01/04/2023','dd/mm/yyyy') and Ledger.Dtoftran<=to_date('31/03/2024','dd/mm/yyyy') and Journal.nEntrytype!=1 group by Ledger.Oowncode ), tbltempportalloc as (Select Coalesce(tblFinledger.cClientcode,tblPortcashfin.cClientcode) as cClientcode, '27' as cRowindicator, Sum(Nvl(tblFinledger.nFiramount,0)+Nvl(tblPortcashfin.nFiramount,0)) as nFiramount, 0 as nSecamount From tblFinledger tblFinledger Full Outer Join tblPortcashfin On tblFinledger.cClientcode=tblPortcashfin.cClientcode and tblFinledger.cRowindicator=tblPortcashfin.cRowindicator Where (tblFinledger.cRowindicator='26' or tblPortcashfin.cRowindicator='25') group by Coalesce(tblFinledger.cClientcode,tblPortcashfin.cClientcode) ), tbltemptotdays as (Select '18' as cRowindicator, (to_date('31/03/2024','dd/mm/yyyy') - to_date('01/04/2024','dd/mm/yyyy'))+1 as nSecamount From dual ), tblFinalloop as (Select tblReportdesc.cRowindicator as cRowindicator, tblReportdesc.cRowdesc as cRowdesc, Coalesce(tblReportdesc.cClientcode,tblOpenstk.cClientcode,tblCapinout.cClientcode,tblPortcashfin.cClientcode,tblPortderfin.cClientcode,tblCashplusderfinal.cClientcode,tblDividend.cClientcode,tbltmpbillcharges.cClientcode,tbltmpbillchgtotal.cClientcode,tblMiscentries.cClientcode,tblFinledger.cClientcode,tbltempPortalloc.cClientcode,tblDirectdividend.cClientcode) as cClientcode, Coalesce(tblOpenstk.nFiramount,tblCapinout.nFiramount,tblPortcashfin.nFiramount,tblPortderfin.nFiramount,tblCashplusderfinal.nFiramount,tblDividend.nFiramount,tbltmpBillcharges.nFiramount,tbltmpbillchgtotal.nFiramount,tblMiscentries.nFiramount,tblFinledger.nFiramount,tbltempPortalloc.nFiramount,tblDirectdividend.nFiramount) as nFiramount, Coalesce(tblOpenstk.nSecamount,tblCapinout.nSecamount,tblPortcashfin.nSecamount,tblPortderfin.nSecamount,tblCashplusderfinal.nSecamount,tblDividend.nSecamount,tbltmpBillcharges.nSecamount,tbltmpBillchgtotal.nSecamount,tblMiscentries.nSecamount,tblFinledger.nSecamount,tbltempPortalloc.nSecamount,tbltempTotdays.nSecamount,tbltempTotdays.nSecamount) as nSecamount From tblReportdesc tblReportdesc Left Outer Join tblOpenstk On tblReportdesc.cRowindicator=tblOpenstk.cRowindicator and tblReportdesc.cClientcode=tblOpenstk.cClientcode Left Outer Join tblCapinout On tblReportdesc.cRowindicator=tblCapinout.cRowindicator and tblReportdesc.cClientcode=tblCapinout.cClientcode Left Outer Join tblPortcashfin On tblReportdesc.cRowindicator=tblPortcashfin.cRowindicator and tblReportdesc.cClientcode=tblPortcashfin.cClientcode Left Outer Join tblPortderfin On tblReportdesc.cRowindicator=tblPortderfin.cRowindicator and tblReportdesc.cClientcode=tblPortderfin.cClientcode Left Outer Join tblCashplusderfinal On tblReportdesc.cRowindicator=tblCashplusderfinal.cRowindicator and tblReportdesc.cClientcode=tblCashplusderfinal.cClientcode Left Outer Join tblDividend On tblReportdesc.cRowindicator=tblDividend.cRowindicator and tblReportdesc.cClientcode=tblDividend.cClientcode Left Outer Join tbltmpBillcharges On tblReportdesc.cRowindicator=tbltmpBillcharges.cRowindicator and tblReportdesc.cClientcode=tbltmpBillcharges.cClientcode Left Outer Join tbltmpbillchgtotal On tblReportdesc.cRowindicator=tbltmpBillchgtotal.cRowindicator and tblReportdesc.cClientcode=tbltmpBillchgtotal.cClientcode Left Outer Join tblMiscentries On tblReportdesc.cRowindicator=tblMiscentries.cRowindicator and tblReportdesc.cClientcode=tblMiscentries.cClientcode Left Outer Join tblFinledger On tblReportdesc.cRowindicator=tblFinledger.cRowindicator and tblReportdesc.cClientcode=tblFinledger.cClientcode Left Outer Join tbltempPortalloc On tblReportdesc.cRowindicator=tbltempPortalloc.cRowindicator and tblReportdesc.cClientcode=tbltempPortalloc.cClientcode Left Outer Join tblDirectdividend On tblReportdesc.cRowindicator=tblDirectdividend.cRowindicator and tblReportdesc.cClientcode=tblDirectdividend.cClientcode Left Outer Join tbltemptotdays On tblReportdesc.cRowindicator=tbltempTotdays.cRowindicator ), tbltempporttotal as ( Select '17' as cRowindicator, tblFinalloop.cClientcode as cClientcode, Sum(tblFinalloop.nSecamount) as nTotalamount From tblFinalloop Where tblFinalloop.cRowindicator!='18' and nvl(trim(tblFinalloop.cClientcode),' ')!=' ' group by tblFinalloop.cClientcode ), tbltemptotalcapital as ( Select tblFinalloop.cClientcode as cClientcode, Sum(tblFinalloop.nSecamount) as nTotalamount From tblFinalloop tblFinalloop Where (tblFinalloop.cRowindicator='02' or tblFinalloop.cRowindicator='01') and nvl(trim(tblFinalloop.cClientcode),' ')!=' ' group by tblFinalloop.cClientcode ) Select tblFinalloop.cRowindicator as cRowindicator, tblFinalloop.cRowdesc as cRowdesc, tblFinalloop.cClientcode as cClientcode, tblFinalloop.nFiramount as nFiramount, Case When (tblFinalloop.cRowindicator=25 or tblFinalloop.cRowindicator=26) and tbltempPortalloc.nFiramount!=0 then Round(tblFinalloop.nFiramount/tbltempPortalloc.nFiramount*100,2) When tblFInalloop.cRowindicator='17' then tbltempporttotal.nTotalamount When tblFinalloop.cRowindicator='19' and tbltemptotalcapital.nTotalamount!=0 then Round((tbltempporttotal.nTotalamount-tbltemptotalcapital.nTotalamount)*100/tbltemptotalcapital.nTotalamount,2) When tblFinalloop.cRowindicator='20' and tbltemptotalcapital.nTotalamount!=0 then Round(((tbltempporttotal.nTotalamount-tbltemptotalcapital.nTotalamount)*100/tbltemptotalcapital.nTotalamount)*365/ ((to_date('31/03/2024','dd/mm/yyyy') - to_date('01/04/2024','dd/mm/yyyy')+1)),2) else tblFinalloop.nSecamount end as nSecamount From tblFinalloop Left Outer Join tbltempportalloc On tblFinalloop.cClientcode=tbltempportalloc.cClientcode Left Outer Join tbltempporttotal On tblFinalloop.cClientcode=tbltempporttotal.cClientcode Left Outer Join tbltemptotalcapital On tblFinalloop.cClientcode=tbltemptotalcapital.cClientcode Order by 1 Title : 01~Error Description : ORA-01476: divisor is equal to zero Method : getglobalportfolioLine : 44015 Message : getGlobalportfolio StackTrace : at OracleInternal.ServiceObjects.OracleConnectionImpl.VerifyExecution(Int32& cursorId, Boolean bThrowArrayBindRelatedErrors, SqlStatementType sqlStatementType, Int32 arrayBindCount, OracleException& exceptionForArrayBindDML, Boolean& hasMoreRowsInDB, Boolean bFirstIterationDone) at OracleInternal.ServiceObjects.OracleCommandImpl.ExecuteReader(String commandText, OracleParameterCollection paramColl, CommandType commandType, OracleConnectionImpl connectionImpl, OracleDataReaderImpl& rdrImpl, Int32 longFetchSize, Int64 clientInitialLOBFS, OracleDependencyImpl orclDependencyImpl, Int64[] scnForExecution, Int64[]& scnFromExecution, OracleParameterCollection& bindByPositionParamColl, Boolean& bBindParamPresent, Int64& internalInitialLOBFS, OracleException& exceptionForArrayBindDML, OracleConnection connection, OracleLogicalTransaction& oracleLogicalTransaction, IEnumerable`1 adrianParsedStmt, Boolean isDescribeOnly, Boolean isFromEF) at Oracle.ManagedDataAccess.Client.OracleCommand.ExecuteReader(Boolean requery, Boolean fillRequest, CommandBehavior behavior) at Oracle.ManagedDataAccess.Client.OracleDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable) at clientlevel.Thinclientlevel.Clientlogin.getglobalportfolio(DateTime tdStartdate, DateTime tdEnddate, DateTime tdPoadate, DateTime tdFinancialstartdate, Int32 tnAngleselection, String tcClientfilter, Cliole loLdcommon) in File25:line 44015 Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 802942976 Shut down : N Username : MOBBO Date/Time : 17/05/2024 11:37:37 AM Connection : Closed =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKD0151536PDF170524113900.pdf$N$~BANKD0151536Image170524113915.png$N$~ Message : UpdateEkycdata StackTrace : tpDocimageforBank Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 923246592 Shut down : N Username : MOBBO Date/Time : 17/05/2024 11:41:08 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKD0151536PDF170524113900.pdf$N$ Message : UpdateEkycdata StackTrace : lcDocsrtring[i] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 923246592 Shut down : N Username : MOBBO Date/Time : 17/05/2024 11:41:08 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKD0151536PDF170524113900.pdf Message : UpdateEkycdata StackTrace : lcProoffile[0] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 923246592 Shut down : N Username : MOBBO Date/Time : 17/05/2024 11:41:08 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKD0151536Image170524113915.png$N$ Message : UpdateEkycdata StackTrace : lcDocsrtring[i] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 923246592 Shut down : N Username : MOBBO Date/Time : 17/05/2024 11:41:08 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKD0151536Image170524113915.png Message : UpdateEkycdata StackTrace : lcProoffile[0] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 923246592 Shut down : N Username : MOBBO Date/Time : 17/05/2024 11:41:08 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Select tblFirmcreation.cshortname as cShortname From tblFirmcreation tblFirmcreation Where tblFirmcreation.cUserFirmcode='NBS-000001' Title : 01~Error Description : Value cannot be null. Parameter name: dataTable Method : AgeingacrossyearLine : 46316 Message : Ageingacrossyear StackTrace : at System.Data.Common.DataAdapter.Fill(DataTable[] dataTables, IDataReader dataReader, Int32 startRecord, Int32 maxRecords) at Oracle.ManagedDataAccess.Client.OracleDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable) at clientlevel.Thinclientlevel.Clientlogin.Ageingacrossyear(DateTime tdTransactiondate, Int32 tnTotaldays1, Int32 tnTotaldays2, Int32 tnTotaldays3, Int32 tnAngleselection, Int32 tnTotaldays4, Int32 tnTotaldays5, Int32 tnTotaldays6, Cliole loLdcommon, Int32 tnTotaldays7, Int32 tnTotaldays8, Int32 tnTotaldays9, Int32 tnTotaldays10, Int32 tnTotaldays11, Int32 tnTotaldays12, Int32 tnIncludepreviousyear, Int32 tnIgnorebounced, Int32 tnonlyReconciledentries, Int32 tnTerminalcodejoin, String& tcCashpayindate, String& tcFopayindate, Int32 tnAgeingonTransactiondate, String tcClientcode, Double tnAmount, String& tcSebiageingdate) in File25:line 46316 Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 780591104 Shut down : N Username : MOBBO Date/Time : 17/05/2024 11:48:23 AM Connection : Closed =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKS0500727Image170524115843.png$N$~ Message : UpdateEkycdata StackTrace : tpDocimageforBank Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 742354944 Shut down : N Username : MOBBO Date/Time : 17/05/2024 11:59:59 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKS0500727Image170524115843.png$N$ Message : UpdateEkycdata StackTrace : lcDocsrtring[i] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 742371328 Shut down : N Username : MOBBO Date/Time : 17/05/2024 11:59:59 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKS0500727Image170524115843.png Message : UpdateEkycdata StackTrace : lcProoffile[0] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 742371328 Shut down : N Username : MOBBO Date/Time : 17/05/2024 11:59:59 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Select tblFirmcreation.cshortname as cShortname From tblFirmcreation tblFirmcreation Where tblFirmcreation.cUserFirmcode='NBS-000001' Title : 01~Error Description : Value cannot be null. Parameter name: dataTable Method : AgeingacrossyearLine : 46316 Message : Ageingacrossyear StackTrace : at System.Data.Common.DataAdapter.Fill(DataTable[] dataTables, IDataReader dataReader, Int32 startRecord, Int32 maxRecords) at Oracle.ManagedDataAccess.Client.OracleDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable) at clientlevel.Thinclientlevel.Clientlogin.Ageingacrossyear(DateTime tdTransactiondate, Int32 tnTotaldays1, Int32 tnTotaldays2, Int32 tnTotaldays3, Int32 tnAngleselection, Int32 tnTotaldays4, Int32 tnTotaldays5, Int32 tnTotaldays6, Cliole loLdcommon, Int32 tnTotaldays7, Int32 tnTotaldays8, Int32 tnTotaldays9, Int32 tnTotaldays10, Int32 tnTotaldays11, Int32 tnTotaldays12, Int32 tnIncludepreviousyear, Int32 tnIgnorebounced, Int32 tnonlyReconciledentries, Int32 tnTerminalcodejoin, String& tcCashpayindate, String& tcFopayindate, Int32 tnAgeingonTransactiondate, String tcClientcode, Double tnAmount, String& tcSebiageingdate) in File25:line 46316 Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 755949568 Shut down : N Username : MOBBO Date/Time : 17/05/2024 12:00:39 PM Connection : Closed =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKLDH7790Image170524120131.png$N$~ Message : UpdateEkycdata StackTrace : tpDocimageforBank Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 711057408 Shut down : N Username : MOBBO Date/Time : 17/05/2024 12:01:52 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKLDH7790Image170524120131.png$N$ Message : UpdateEkycdata StackTrace : lcDocsrtring[i] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 711057408 Shut down : N Username : MOBBO Date/Time : 17/05/2024 12:01:52 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKLDH7790Image170524120131.png Message : UpdateEkycdata StackTrace : lcProoffile[0] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 711057408 Shut down : N Username : MOBBO Date/Time : 17/05/2024 12:01:52 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKS0500727Image170524121221.png$N$~ Message : UpdateEkycdata StackTrace : tpDocimageforBank Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 380657664 Shut down : N Username : MOBBO Date/Time : 17/05/2024 12:13:08 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKS0500727Image170524121221.png$N$ Message : UpdateEkycdata StackTrace : lcDocsrtring[i] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 380674048 Shut down : N Username : MOBBO Date/Time : 17/05/2024 12:13:08 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKS0500727Image170524121221.png Message : UpdateEkycdata StackTrace : lcProoffile[0] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 380674048 Shut down : N Username : MOBBO Date/Time : 17/05/2024 12:13:08 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Merge into tblCCMekycbankchqrmkr@lnk_ccm T1 using ( Select 'NBS-000001' as cFirmnumber, 'S0500727' as cClientcode,34111 as nEkycrefno from dual ) T2 on (T1.cFirmnumber=T2.cFirmnumber and T1.cClientcode=T2.cClientcode and T1.nEkycdoucmentno=T2.nEkycrefno) when matched then update set cBankcode='716',cBankname='DHANALAKSHMI BANK LTD',cIfsccode='DLXB0000006',cMicrcode='680048010',cBranchname='VADANAP',cBankacno='000600100034948', cChqprintname='MADANASUNDARAN V M', cbankactype='Savings', cDefaultbank='Y', dApiverificationstart=to_date('17/05/2024 12:12:50','dd/MM/yyyy hh24:mi:ss'),dApiresponcerecd=sysdate,cApiresponceid='LL9WXFU6I9TZ751', cNameasperresponce='MADANASUNDARAN V M',cMaker='NxYejJnJyPfQx7bsUKadYw==' when not matched then Insert (cFirmnumber,cClientcode,nEkycdoucmentno,cBankcode,cBankname,cIfsccode,cMicrcode,cBranchname,cBankacno,cChqprintname, cbankactype,cDefaultbank, dApiverificationstart,dApiresponcerecd,cApiresponceid,cNameasperresponce,cMaker,cChecker) Values ('NBS-000001', 'S0500727',34111,'716','DHANALAKSHMI BANK LTD','DLXB0000006','680048010','VADANAP','000600100034948','MADANASUNDARAN V M', 'Savings', 'Y', to_date('17/05/2024 12:12:50','dd/MM/yyyy hh24:mi:ss'),sysdate,'LL9WXFU6I9TZ751','MADANASUNDARAN V M','NxYejJnJyPfQx7bsUKadYw==',' ') Title : 01~Error Description : Could not find file 'D:\Inetpub\wwwroot\LdMobileService\EkycDocimages\BANKS0500727Image170524121221.png'. Method : UpdateEkycdataLine : 71449 Message : UpdateEkycdata StackTrace : at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) at System.IO.File.InternalReadAllBytes(String path, Boolean checkHost) at ekyc.ekycdata.UpdateEkycdata(Cliole loLdcommon, Int32 tnAngleselection, String tcClientcode, String tcRequstType, String tcMobile, String tcEmailaddress, String tcClientname, String tcFirstname, String tcSecondname, String tcLastname, String tcCorraddressline1, String tcCorraddressline2, String tcCorraddressline3, String tcCorraddresscity, String tnCorrpin, String tcCorrstate, String tcCorrstateother, String tcCorrcountry, String tcCorraddressproof, String tcCorraddressrefid, String tdCorraddressproofissuedt, String tdCorraddressproofexpirydt, String tcPfraddressline1, String tcPfraddressline2, String tcPfraddressline3, String tcPfraddresscity, Int32 tnPfrpin, String tcPfrstate, String tcPfrstateother, String tcPfrcountry, String tcPfraddressproof, String tcPfraddressproofrefid, String tdPfraddressproofissuedt, String tdPfraddressproofexpirydt, String tcResdstatuscode, String tcGender, String tcMaritalstatus, String tcFatherSpousename, String tcNationality, String tcPrefixmaidenname, String tcApplicantMaidenname, String tcPrefixfatherspouse, String tcPrefixmothername, String tcMothername, String tcMothermaidenname, String tcFatcaProofofaddress, String tcFatcaIdnumber, String tcFatcataxresidence, String tcCountryofbirth, String tcCityofbirth, Int64 tnAnnualincome, Int64 tnNetworth, String tdNetworth, String tcDeviceinfo, Int32 tnUpdateKYC, Int32 tnUpdateaddress, Int32 tnUpadateFatca, Int32 tnUpdateMobile, Int32 tnUpdateemail, Int32 tnUpdateBank, Int32 tnUpdateDemat, String tcUserid, String tcFatherHusbandflag, String tpDocimageforAddress, String tpDocimageforKYC, String tpDocimageforFatca, String tcBankdetails, String tpDocimageforBank, String tcDematdetails, String tpDocimageforDemat, String tcOccupation, String tcEsigneddoneby, Int64& tnEkycDocumentno, String tcFilepath, String tcAddressasperKyc, Int64 tnEkycreferenceno, String tcUseraction, String tcIdentifier, String tcEsignPdffilename, String& tceSigndocumentid, Cliole loCCMcon, String tcEsignmethod, String tcEmailFamily, String tcEconfirmation, String tcMobilefamily, Int32 tnUpdateOtherdetails, String tdDOB, String tcAadharnumber, String tceducation, String tcInternettradingflag, String tcDPfees, String tcIBTdetails, String tcIPVproofdetails, String tcDepository, Int32 tnInternetsoftware, String tcKRAAddressIPV, Boolean tlEsignwithClientname, Int32 tnUpdatenominee, String tcNomineedetails, String tcNomineeproof, String tcClientSignaturefile, String tcNomineeopted, String tcNomineeoptout, Int32 tnUpdateSegment, String tcSegmentActivationdetails, String tcSegmentDeActivationdetails, String tcSegmentproofdetails, String tcSchemecode, String tcEsigncoordinator, String tcsubcategoryforcomm, String tcCommodiyitemlist, String tcDerConsentgiven) in File25:line 71449 Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 381755392 Shut down : N Username : MOBBO Date/Time : 17/05/2024 12:13:08 PM Connection : Closed =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Merge into tblCCMekycbankchqrmkr@lnk_ccm T1 using ( Select 'NBS-000001' as cFirmnumber, 'N6420038' as cClientcode,34112 as nEkycrefno from dual ) T2 on (T1.cFirmnumber=T2.cFirmnumber and T1.cClientcode=T2.cClientcode and T1.nEkycdoucmentno=T2.nEkycrefno) when matched then update set cBankcode='24',cBankname='BANK OF MAHARASHTRA',cIfsccode='MAHB0001349',cMicrcode='411014100',cBranchname='PUNE',cBankacno='60354384167', cChqprintname='RAJENDRA BAJIRAV HINGE', cbankactype='Savings', cDefaultbank='Y', dApiverificationstart=to_date('१७/०५/२०२४ १२:१९:०५','dd/MM/yyyy hh24:mi:ss'),dApiresponcerecd=sysdate,cApiresponceid='81JZECFUIPM8IIZ', cNameasperresponce='Mr RAJENDRA BAJIRAV HINGE',cMaker='fvXNLVOSECxWzHGZo4mmXg==' when not matched then Insert (cFirmnumber,cClientcode,nEkycdoucmentno,cBankcode,cBankname,cIfsccode,cMicrcode,cBranchname,cBankacno,cChqprintname, cbankactype,cDefaultbank, dApiverificationstart,dApiresponcerecd,cApiresponceid,cNameasperresponce,cMaker,cChecker) Values ('NBS-000001', 'N6420038',34112,'24','BANK OF MAHARASHTRA','MAHB0001349','411014100','PUNE','60354384167','RAJENDRA BAJIRAV HINGE', 'Savings', 'Y', to_date('१७/०५/२०२४ १२:१९:०५','dd/MM/yyyy hh24:mi:ss'),sysdate,'81JZECFUIPM8IIZ','Mr RAJENDRA BAJIRAV HINGE','fvXNLVOSECxWzHGZo4mmXg==',' ') Title : 01~Error Description : ORA-01858: a non-numeric character was found where a numeric was expected ORA-02063: preceding line from LNK_CCM Method : UpdateEkycdataLine : 70634 Message : UpdateEkycdata StackTrace : at OracleInternal.ServiceObjects.OracleConnectionImpl.VerifyExecution(Int32& cursorId, Boolean bThrowArrayBindRelatedErrors, SqlStatementType sqlStatementType, Int32 arrayBindCount, OracleException& exceptionForArrayBindDML, Boolean& hasMoreRowsInDB, Boolean bFirstIterationDone) at OracleInternal.ServiceObjects.OracleCommandImpl.ExecuteNonQuery(String commandText, OracleParameterCollection paramColl, CommandType commandType, OracleConnectionImpl connectionImpl, Int32 longFetchSize, Int64 clientInitialLOBFS, OracleDependencyImpl orclDependencyImpl, Int64[]& scnFromExecution, OracleParameterCollection& bindByPositionParamColl, Boolean& bBindParamPresent, OracleException& exceptionForArrayBindDML, OracleConnection connection, OracleLogicalTransaction& oracleLogicalTransaction, Boolean isFromEF) at Oracle.ManagedDataAccess.Client.OracleCommand.ExecuteNonQuery() at ekyc.ekycdata.UpdateEkycdata(Cliole loLdcommon, Int32 tnAngleselection, String tcClientcode, String tcRequstType, String tcMobile, String tcEmailaddress, String tcClientname, String tcFirstname, String tcSecondname, String tcLastname, String tcCorraddressline1, String tcCorraddressline2, String tcCorraddressline3, String tcCorraddresscity, String tnCorrpin, String tcCorrstate, String tcCorrstateother, String tcCorrcountry, String tcCorraddressproof, String tcCorraddressrefid, String tdCorraddressproofissuedt, String tdCorraddressproofexpirydt, String tcPfraddressline1, String tcPfraddressline2, String tcPfraddressline3, String tcPfraddresscity, Int32 tnPfrpin, String tcPfrstate, String tcPfrstateother, String tcPfrcountry, String tcPfraddressproof, String tcPfraddressproofrefid, String tdPfraddressproofissuedt, String tdPfraddressproofexpirydt, String tcResdstatuscode, String tcGender, String tcMaritalstatus, String tcFatherSpousename, String tcNationality, String tcPrefixmaidenname, String tcApplicantMaidenname, String tcPrefixfatherspouse, String tcPrefixmothername, String tcMothername, String tcMothermaidenname, String tcFatcaProofofaddress, String tcFatcaIdnumber, String tcFatcataxresidence, String tcCountryofbirth, String tcCityofbirth, Int64 tnAnnualincome, Int64 tnNetworth, String tdNetworth, String tcDeviceinfo, Int32 tnUpdateKYC, Int32 tnUpdateaddress, Int32 tnUpadateFatca, Int32 tnUpdateMobile, Int32 tnUpdateemail, Int32 tnUpdateBank, Int32 tnUpdateDemat, String tcUserid, String tcFatherHusbandflag, String tpDocimageforAddress, String tpDocimageforKYC, String tpDocimageforFatca, String tcBankdetails, String tpDocimageforBank, String tcDematdetails, String tpDocimageforDemat, String tcOccupation, String tcEsigneddoneby, Int64& tnEkycDocumentno, String tcFilepath, String tcAddressasperKyc, Int64 tnEkycreferenceno, String tcUseraction, String tcIdentifier, String tcEsignPdffilename, String& tceSigndocumentid, Cliole loCCMcon, String tcEsignmethod, String tcEmailFamily, String tcEconfirmation, String tcMobilefamily, Int32 tnUpdateOtherdetails, String tdDOB, String tcAadharnumber, String tceducation, String tcInternettradingflag, String tcDPfees, String tcIBTdetails, String tcIPVproofdetails, String tcDepository, Int32 tnInternetsoftware, String tcKRAAddressIPV, Boolean tlEsignwithClientname, Int32 tnUpdatenominee, String tcNomineedetails, String tcNomineeproof, String tcClientSignaturefile, String tcNomineeopted, String tcNomineeoptout, Int32 tnUpdateSegment, String tcSegmentActivationdetails, String tcSegmentDeActivationdetails, String tcSegmentproofdetails, String tcSchemecode, String tcEsigncoordinator, String tcsubcategoryforcomm, String tcCommodiyitemlist, String tcDerConsentgiven) in File25:line 70634 Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 882765824 Shut down : N Username : MOBBO Date/Time : 17/05/2024 12:19:21 PM Connection : Closed =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Merge into tblCCMekycbankchqrmkr@lnk_ccm T1 using ( Select 'NBS-000001' as cFirmnumber, 'N6420038' as cClientcode,34113 as nEkycrefno from dual ) T2 on (T1.cFirmnumber=T2.cFirmnumber and T1.cClientcode=T2.cClientcode and T1.nEkycdoucmentno=T2.nEkycrefno) when matched then update set cBankcode='24',cBankname='BANK OF MAHARASHTRA',cIfsccode='MAHB0001349',cMicrcode='411014100',cBranchname='PUNE',cBankacno='60354384167', cChqprintname='RAJENDRA BAJIRAV HINGE', cbankactype='Savings', cDefaultbank='Y', dApiverificationstart=to_date('१७/०५/२०२४ १२:१९:०५','dd/MM/yyyy hh24:mi:ss'),dApiresponcerecd=sysdate,cApiresponceid='81JZECFUIPM8IIZ', cNameasperresponce='Mr RAJENDRA BAJIRAV HINGE',cMaker='fvXNLVOSECxWzHGZo4mmXg==' when not matched then Insert (cFirmnumber,cClientcode,nEkycdoucmentno,cBankcode,cBankname,cIfsccode,cMicrcode,cBranchname,cBankacno,cChqprintname, cbankactype,cDefaultbank, dApiverificationstart,dApiresponcerecd,cApiresponceid,cNameasperresponce,cMaker,cChecker) Values ('NBS-000001', 'N6420038',34113,'24','BANK OF MAHARASHTRA','MAHB0001349','411014100','PUNE','60354384167','RAJENDRA BAJIRAV HINGE', 'Savings', 'Y', to_date('१७/०५/२०२४ १२:१९:०५','dd/MM/yyyy hh24:mi:ss'),sysdate,'81JZECFUIPM8IIZ','Mr RAJENDRA BAJIRAV HINGE','fvXNLVOSECxWzHGZo4mmXg==',' ') Title : 01~Error Description : ORA-01858: a non-numeric character was found where a numeric was expected ORA-02063: preceding line from LNK_CCM Method : UpdateEkycdataLine : 70634 Message : UpdateEkycdata StackTrace : at OracleInternal.ServiceObjects.OracleConnectionImpl.VerifyExecution(Int32& cursorId, Boolean bThrowArrayBindRelatedErrors, SqlStatementType sqlStatementType, Int32 arrayBindCount, OracleException& exceptionForArrayBindDML, Boolean& hasMoreRowsInDB, Boolean bFirstIterationDone) at OracleInternal.ServiceObjects.OracleCommandImpl.ExecuteNonQuery(String commandText, OracleParameterCollection paramColl, CommandType commandType, OracleConnectionImpl connectionImpl, Int32 longFetchSize, Int64 clientInitialLOBFS, OracleDependencyImpl orclDependencyImpl, Int64[]& scnFromExecution, OracleParameterCollection& bindByPositionParamColl, Boolean& bBindParamPresent, OracleException& exceptionForArrayBindDML, OracleConnection connection, OracleLogicalTransaction& oracleLogicalTransaction, Boolean isFromEF) at Oracle.ManagedDataAccess.Client.OracleCommand.ExecuteNonQuery() at ekyc.ekycdata.UpdateEkycdata(Cliole loLdcommon, Int32 tnAngleselection, String tcClientcode, String tcRequstType, String tcMobile, String tcEmailaddress, String tcClientname, String tcFirstname, String tcSecondname, String tcLastname, String tcCorraddressline1, String tcCorraddressline2, String tcCorraddressline3, String tcCorraddresscity, String tnCorrpin, String tcCorrstate, String tcCorrstateother, String tcCorrcountry, String tcCorraddressproof, String tcCorraddressrefid, String tdCorraddressproofissuedt, String tdCorraddressproofexpirydt, String tcPfraddressline1, String tcPfraddressline2, String tcPfraddressline3, String tcPfraddresscity, Int32 tnPfrpin, String tcPfrstate, String tcPfrstateother, String tcPfrcountry, String tcPfraddressproof, String tcPfraddressproofrefid, String tdPfraddressproofissuedt, String tdPfraddressproofexpirydt, String tcResdstatuscode, String tcGender, String tcMaritalstatus, String tcFatherSpousename, String tcNationality, String tcPrefixmaidenname, String tcApplicantMaidenname, String tcPrefixfatherspouse, String tcPrefixmothername, String tcMothername, String tcMothermaidenname, String tcFatcaProofofaddress, String tcFatcaIdnumber, String tcFatcataxresidence, String tcCountryofbirth, String tcCityofbirth, Int64 tnAnnualincome, Int64 tnNetworth, String tdNetworth, String tcDeviceinfo, Int32 tnUpdateKYC, Int32 tnUpdateaddress, Int32 tnUpadateFatca, Int32 tnUpdateMobile, Int32 tnUpdateemail, Int32 tnUpdateBank, Int32 tnUpdateDemat, String tcUserid, String tcFatherHusbandflag, String tpDocimageforAddress, String tpDocimageforKYC, String tpDocimageforFatca, String tcBankdetails, String tpDocimageforBank, String tcDematdetails, String tpDocimageforDemat, String tcOccupation, String tcEsigneddoneby, Int64& tnEkycDocumentno, String tcFilepath, String tcAddressasperKyc, Int64 tnEkycreferenceno, String tcUseraction, String tcIdentifier, String tcEsignPdffilename, String& tceSigndocumentid, Cliole loCCMcon, String tcEsignmethod, String tcEmailFamily, String tcEconfirmation, String tcMobilefamily, Int32 tnUpdateOtherdetails, String tdDOB, String tcAadharnumber, String tceducation, String tcInternettradingflag, String tcDPfees, String tcIBTdetails, String tcIPVproofdetails, String tcDepository, Int32 tnInternetsoftware, String tcKRAAddressIPV, Boolean tlEsignwithClientname, Int32 tnUpdatenominee, String tcNomineedetails, String tcNomineeproof, String tcClientSignaturefile, String tcNomineeopted, String tcNomineeoptout, Int32 tnUpdateSegment, String tcSegmentActivationdetails, String tcSegmentDeActivationdetails, String tcSegmentproofdetails, String tcSchemecode, String tcEsigncoordinator, String tcsubcategoryforcomm, String tcCommodiyitemlist, String tcDerConsentgiven) in File25:line 70634 Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 817483776 Shut down : N Username : MOBBO Date/Time : 17/05/2024 12:20:22 PM Connection : Closed =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKS8390026Image170524122033.png$N$~ Message : UpdateEkycdata StackTrace : tpDocimageforBank Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 768331776 Shut down : N Username : MOBBO Date/Time : 17/05/2024 12:20:43 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKS8390026Image170524122033.png$N$ Message : UpdateEkycdata StackTrace : lcDocsrtring[i] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 768331776 Shut down : N Username : MOBBO Date/Time : 17/05/2024 12:20:43 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKS8390026Image170524122033.png Message : UpdateEkycdata StackTrace : lcProoffile[0] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 768331776 Shut down : N Username : MOBBO Date/Time : 17/05/2024 12:20:43 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Merge into tblCCMekycbankchqrmkr@lnk_ccm T1 using ( Select 'NBS-000001' as cFirmnumber, 'N6420038' as cClientcode,34115 as nEkycrefno from dual ) T2 on (T1.cFirmnumber=T2.cFirmnumber and T1.cClientcode=T2.cClientcode and T1.nEkycdoucmentno=T2.nEkycrefno) when matched then update set cBankcode='24',cBankname='BANK OF MAHARASHTRA',cIfsccode='MAHB0001349',cMicrcode='411014100',cBranchname='PUNE',cBankacno='60354384167', cChqprintname='RAJENDRA BAJIRAV HINGE', cbankactype='Savings', cDefaultbank='Y', dApiverificationstart=to_date('१७/०५/२०२४ १२:१९:०५','dd/MM/yyyy hh24:mi:ss'),dApiresponcerecd=sysdate,cApiresponceid='81JZECFUIPM8IIZ', cNameasperresponce='Mr RAJENDRA BAJIRAV HINGE',cMaker='fvXNLVOSECxWzHGZo4mmXg==' when not matched then Insert (cFirmnumber,cClientcode,nEkycdoucmentno,cBankcode,cBankname,cIfsccode,cMicrcode,cBranchname,cBankacno,cChqprintname, cbankactype,cDefaultbank, dApiverificationstart,dApiresponcerecd,cApiresponceid,cNameasperresponce,cMaker,cChecker) Values ('NBS-000001', 'N6420038',34115,'24','BANK OF MAHARASHTRA','MAHB0001349','411014100','PUNE','60354384167','RAJENDRA BAJIRAV HINGE', 'Savings', 'Y', to_date('१७/०५/२०२४ १२:१९:०५','dd/MM/yyyy hh24:mi:ss'),sysdate,'81JZECFUIPM8IIZ','Mr RAJENDRA BAJIRAV HINGE','fvXNLVOSECxWzHGZo4mmXg==',' ') Title : 01~Error Description : ORA-01858: a non-numeric character was found where a numeric was expected ORA-02063: preceding line from LNK_CCM Method : UpdateEkycdataLine : 70634 Message : UpdateEkycdata StackTrace : at OracleInternal.ServiceObjects.OracleConnectionImpl.VerifyExecution(Int32& cursorId, Boolean bThrowArrayBindRelatedErrors, SqlStatementType sqlStatementType, Int32 arrayBindCount, OracleException& exceptionForArrayBindDML, Boolean& hasMoreRowsInDB, Boolean bFirstIterationDone) at OracleInternal.ServiceObjects.OracleCommandImpl.ExecuteNonQuery(String commandText, OracleParameterCollection paramColl, CommandType commandType, OracleConnectionImpl connectionImpl, Int32 longFetchSize, Int64 clientInitialLOBFS, OracleDependencyImpl orclDependencyImpl, Int64[]& scnFromExecution, OracleParameterCollection& bindByPositionParamColl, Boolean& bBindParamPresent, OracleException& exceptionForArrayBindDML, OracleConnection connection, OracleLogicalTransaction& oracleLogicalTransaction, Boolean isFromEF) at Oracle.ManagedDataAccess.Client.OracleCommand.ExecuteNonQuery() at ekyc.ekycdata.UpdateEkycdata(Cliole loLdcommon, Int32 tnAngleselection, String tcClientcode, String tcRequstType, String tcMobile, String tcEmailaddress, String tcClientname, String tcFirstname, String tcSecondname, String tcLastname, String tcCorraddressline1, String tcCorraddressline2, String tcCorraddressline3, String tcCorraddresscity, String tnCorrpin, String tcCorrstate, String tcCorrstateother, String tcCorrcountry, String tcCorraddressproof, String tcCorraddressrefid, String tdCorraddressproofissuedt, String tdCorraddressproofexpirydt, String tcPfraddressline1, String tcPfraddressline2, String tcPfraddressline3, String tcPfraddresscity, Int32 tnPfrpin, String tcPfrstate, String tcPfrstateother, String tcPfrcountry, String tcPfraddressproof, String tcPfraddressproofrefid, String tdPfraddressproofissuedt, String tdPfraddressproofexpirydt, String tcResdstatuscode, String tcGender, String tcMaritalstatus, String tcFatherSpousename, String tcNationality, String tcPrefixmaidenname, String tcApplicantMaidenname, String tcPrefixfatherspouse, String tcPrefixmothername, String tcMothername, String tcMothermaidenname, String tcFatcaProofofaddress, String tcFatcaIdnumber, String tcFatcataxresidence, String tcCountryofbirth, String tcCityofbirth, Int64 tnAnnualincome, Int64 tnNetworth, String tdNetworth, String tcDeviceinfo, Int32 tnUpdateKYC, Int32 tnUpdateaddress, Int32 tnUpadateFatca, Int32 tnUpdateMobile, Int32 tnUpdateemail, Int32 tnUpdateBank, Int32 tnUpdateDemat, String tcUserid, String tcFatherHusbandflag, String tpDocimageforAddress, String tpDocimageforKYC, String tpDocimageforFatca, String tcBankdetails, String tpDocimageforBank, String tcDematdetails, String tpDocimageforDemat, String tcOccupation, String tcEsigneddoneby, Int64& tnEkycDocumentno, String tcFilepath, String tcAddressasperKyc, Int64 tnEkycreferenceno, String tcUseraction, String tcIdentifier, String tcEsignPdffilename, String& tceSigndocumentid, Cliole loCCMcon, String tcEsignmethod, String tcEmailFamily, String tcEconfirmation, String tcMobilefamily, Int32 tnUpdateOtherdetails, String tdDOB, String tcAadharnumber, String tceducation, String tcInternettradingflag, String tcDPfees, String tcIBTdetails, String tcIPVproofdetails, String tcDepository, Int32 tnInternetsoftware, String tcKRAAddressIPV, Boolean tlEsignwithClientname, Int32 tnUpdatenominee, String tcNomineedetails, String tcNomineeproof, String tcClientSignaturefile, String tcNomineeopted, String tcNomineeoptout, Int32 tnUpdateSegment, String tcSegmentActivationdetails, String tcSegmentDeActivationdetails, String tcSegmentproofdetails, String tcSchemecode, String tcEsigncoordinator, String tcsubcategoryforcomm, String tcCommodiyitemlist, String tcDerConsentgiven) in File25:line 70634 Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 770281472 Shut down : N Username : MOBBO Date/Time : 17/05/2024 12:20:43 PM Connection : Closed =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKJKR677PDF170524122354.pdf$N$~ Message : UpdateEkycdata StackTrace : tpDocimageforBank Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 790450176 Shut down : N Username : MOBBO Date/Time : 17/05/2024 12:28:08 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKJKR677PDF170524122354.pdf$N$ Message : UpdateEkycdata StackTrace : lcDocsrtring[i] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 790466560 Shut down : N Username : MOBBO Date/Time : 17/05/2024 12:28:08 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKJKR677PDF170524122354.pdf Message : UpdateEkycdata StackTrace : lcProoffile[0] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 790466560 Shut down : N Username : MOBBO Date/Time : 17/05/2024 12:28:08 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : Message : UpdateEkycdata StackTrace : tpDocimageforBank Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 497819648 Shut down : N Username : MOBBO Date/Time : 17/05/2024 12:45:05 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKS3120014Image170524124802.png$N$~ Message : UpdateEkycdata StackTrace : tpDocimageforBank Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 874930176 Shut down : N Username : MOBBO Date/Time : 17/05/2024 12:48:23 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKS3120014Image170524124802.png$N$ Message : UpdateEkycdata StackTrace : lcDocsrtring[i] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 874930176 Shut down : N Username : MOBBO Date/Time : 17/05/2024 12:48:23 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKS3120014Image170524124802.png Message : UpdateEkycdata StackTrace : lcProoffile[0] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 874930176 Shut down : N Username : MOBBO Date/Time : 17/05/2024 12:48:23 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : Message : UpdateEkycdata StackTrace : tpDocimageforBank Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 832925696 Shut down : N Username : MOBBO Date/Time : 17/05/2024 12:50:07 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : Message : UpdateEkycdata StackTrace : tpDocimageforBank Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 764035072 Shut down : N Username : MOBBO Date/Time : 17/05/2024 12:56:06 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : Message : UpdateEkycdata StackTrace : tpDocimageforBank Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 772386816 Shut down : N Username : MOBBO Date/Time : 17/05/2024 12:58:55 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : 01~Error Description : ORA-02291: integrity constraint (LDBO.FK_CLIENTBANK) violated - parent key not found Method : PaymentReq_SaveLine : 36368 Message : Paymentrequest_save StackTrace : at OracleInternal.ServiceObjects.OracleConnectionImpl.VerifyExecution(Int32& cursorId, Boolean bThrowArrayBindRelatedErrors, SqlStatementType sqlStatementType, Int32 arrayBindCount, OracleException& exceptionForArrayBindDML, Boolean& hasMoreRowsInDB, Boolean bFirstIterationDone) at OracleInternal.ServiceObjects.OracleCommandImpl.ExecuteNonQuery(String commandText, OracleParameterCollection paramColl, CommandType commandType, OracleConnectionImpl connectionImpl, Int32 longFetchSize, Int64 clientInitialLOBFS, OracleDependencyImpl orclDependencyImpl, Int64[]& scnFromExecution, OracleParameterCollection& bindByPositionParamColl, Boolean& bBindParamPresent, OracleException& exceptionForArrayBindDML, OracleConnection connection, OracleLogicalTransaction& oracleLogicalTransaction, Boolean isFromEF) at Oracle.ManagedDataAccess.Client.OracleCommand.ExecuteNonQuery() at clientlevel.Thinclientlevel.Clientlogin.PaymentReq_Save(String tcPaymentRequestXmlFile, String tcFilePath, Int32 tnProductCode, String tcEntryMethod, Cliole loLdcommon, String tcClientcode) in File25:line 36368 Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 429006848 Shut down : N Username : MOBBO Date/Time : 17/05/2024 1:04:52 PM Connection : Closed =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : Message : UpdateEkycdata StackTrace : tpDocimageforBank Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 486363136 Shut down : N Username : MOBBO Date/Time : 17/05/2024 1:05:09 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKA4050008Image170524010834.png$N$~ Message : UpdateEkycdata StackTrace : tpDocimageforBank Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 1111093248 Shut down : N Username : MOBBO Date/Time : 17/05/2024 1:08:50 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKA4050008Image170524010834.png$N$ Message : UpdateEkycdata StackTrace : lcDocsrtring[i] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 1111093248 Shut down : N Username : MOBBO Date/Time : 17/05/2024 1:08:50 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKA4050008Image170524010834.png Message : UpdateEkycdata StackTrace : lcProoffile[0] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 1111093248 Shut down : N Username : MOBBO Date/Time : 17/05/2024 1:08:50 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKNVSBPJ1Image170524010838.png$N$~ Message : UpdateEkycdata StackTrace : tpDocimageforBank Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 1080606720 Shut down : N Username : MOBBO Date/Time : 17/05/2024 1:09:04 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKNVSBPJ1Image170524010838.png$N$ Message : UpdateEkycdata StackTrace : lcDocsrtring[i] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 1080606720 Shut down : N Username : MOBBO Date/Time : 17/05/2024 1:09:04 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKNVSBPJ1Image170524010838.png Message : UpdateEkycdata StackTrace : lcProoffile[0] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 1080606720 Shut down : N Username : MOBBO Date/Time : 17/05/2024 1:09:04 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKNIC012Image170524012011.png$N$~ Message : UpdateEkycdata StackTrace : tpDocimageforBank Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 799797248 Shut down : N Username : MOBBO Date/Time : 17/05/2024 1:20:29 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKNIC012Image170524012011.png$N$ Message : UpdateEkycdata StackTrace : lcDocsrtring[i] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 799813632 Shut down : N Username : MOBBO Date/Time : 17/05/2024 1:20:29 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKNIC012Image170524012011.png Message : UpdateEkycdata StackTrace : lcProoffile[0] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 799813632 Shut down : N Username : MOBBO Date/Time : 17/05/2024 1:20:29 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Select tblFirmcreation.cshortname as cShortname From tblFirmcreation tblFirmcreation Where tblFirmcreation.cUserFirmcode='NBS-000001' Title : 01~Error Description : Value cannot be null. Parameter name: dataTable Method : AgeingacrossyearLine : 46316 Message : Ageingacrossyear StackTrace : at System.Data.Common.DataAdapter.Fill(DataTable[] dataTables, IDataReader dataReader, Int32 startRecord, Int32 maxRecords) at Oracle.ManagedDataAccess.Client.OracleDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable) at clientlevel.Thinclientlevel.Clientlogin.Ageingacrossyear(DateTime tdTransactiondate, Int32 tnTotaldays1, Int32 tnTotaldays2, Int32 tnTotaldays3, Int32 tnAngleselection, Int32 tnTotaldays4, Int32 tnTotaldays5, Int32 tnTotaldays6, Cliole loLdcommon, Int32 tnTotaldays7, Int32 tnTotaldays8, Int32 tnTotaldays9, Int32 tnTotaldays10, Int32 tnTotaldays11, Int32 tnTotaldays12, Int32 tnIncludepreviousyear, Int32 tnIgnorebounced, Int32 tnonlyReconciledentries, Int32 tnTerminalcodejoin, String& tcCashpayindate, String& tcFopayindate, Int32 tnAgeingonTransactiondate, String tcClientcode, Double tnAmount, String& tcSebiageingdate) in File25:line 46316 Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 549994496 Shut down : N Username : MOBBO Date/Time : 17/05/2024 1:49:20 PM Connection : Closed =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Select tblFirmcreation.cshortname as cShortname From tblFirmcreation tblFirmcreation Where tblFirmcreation.cUserFirmcode='NBS-000001' Title : 01~Error Description : Value cannot be null. Parameter name: dataTable Method : AgeingacrossyearLine : 46316 Message : Ageingacrossyear StackTrace : at System.Data.Common.DataAdapter.Fill(DataTable[] dataTables, IDataReader dataReader, Int32 startRecord, Int32 maxRecords) at Oracle.ManagedDataAccess.Client.OracleDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable) at clientlevel.Thinclientlevel.Clientlogin.Ageingacrossyear(DateTime tdTransactiondate, Int32 tnTotaldays1, Int32 tnTotaldays2, Int32 tnTotaldays3, Int32 tnAngleselection, Int32 tnTotaldays4, Int32 tnTotaldays5, Int32 tnTotaldays6, Cliole loLdcommon, Int32 tnTotaldays7, Int32 tnTotaldays8, Int32 tnTotaldays9, Int32 tnTotaldays10, Int32 tnTotaldays11, Int32 tnTotaldays12, Int32 tnIncludepreviousyear, Int32 tnIgnorebounced, Int32 tnonlyReconciledentries, Int32 tnTerminalcodejoin, String& tcCashpayindate, String& tcFopayindate, Int32 tnAgeingonTransactiondate, String tcClientcode, Double tnAmount, String& tcSebiageingdate) in File25:line 46316 Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 822730752 Shut down : N Username : MOBBO Date/Time : 17/05/2024 1:52:24 PM Connection : Closed =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKS3030286Image170524023428.png$N$~ Message : UpdateEkycdata StackTrace : tpDocimageforBank Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 758366208 Shut down : N Username : MOBBO Date/Time : 17/05/2024 2:34:53 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKS3030286Image170524023428.png$N$ Message : UpdateEkycdata StackTrace : lcDocsrtring[i] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 758337536 Shut down : N Username : MOBBO Date/Time : 17/05/2024 2:34:53 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKS3030286Image170524023428.png Message : UpdateEkycdata StackTrace : lcProoffile[0] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 758337536 Shut down : N Username : MOBBO Date/Time : 17/05/2024 2:34:53 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : 01~Error Description : ORA-02291: integrity constraint (LDBO.FK_CLIENTBANK) violated - parent key not found Method : PaymentReq_SaveLine : 36368 Message : Paymentrequest_save StackTrace : at OracleInternal.ServiceObjects.OracleConnectionImpl.VerifyExecution(Int32& cursorId, Boolean bThrowArrayBindRelatedErrors, SqlStatementType sqlStatementType, Int32 arrayBindCount, OracleException& exceptionForArrayBindDML, Boolean& hasMoreRowsInDB, Boolean bFirstIterationDone) at OracleInternal.ServiceObjects.OracleCommandImpl.ExecuteNonQuery(String commandText, OracleParameterCollection paramColl, CommandType commandType, OracleConnectionImpl connectionImpl, Int32 longFetchSize, Int64 clientInitialLOBFS, OracleDependencyImpl orclDependencyImpl, Int64[]& scnFromExecution, OracleParameterCollection& bindByPositionParamColl, Boolean& bBindParamPresent, OracleException& exceptionForArrayBindDML, OracleConnection connection, OracleLogicalTransaction& oracleLogicalTransaction, Boolean isFromEF) at Oracle.ManagedDataAccess.Client.OracleCommand.ExecuteNonQuery() at clientlevel.Thinclientlevel.Clientlogin.PaymentReq_Save(String tcPaymentRequestXmlFile, String tcFilePath, Int32 tnProductCode, String tcEntryMethod, Cliole loLdcommon, String tcClientcode) in File25:line 36368 Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 973864960 Shut down : N Username : MOBBO Date/Time : 17/05/2024 2:38:32 PM Connection : Closed =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKJJR5033Image170524023821.png$N$~ Message : UpdateEkycdata StackTrace : tpDocimageforBank Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 998199296 Shut down : N Username : MOBBO Date/Time : 17/05/2024 2:40:12 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKJJR5033Image170524023821.png$N$ Message : UpdateEkycdata StackTrace : lcDocsrtring[i] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 998199296 Shut down : N Username : MOBBO Date/Time : 17/05/2024 2:40:12 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKJJR5033Image170524023821.png Message : UpdateEkycdata StackTrace : lcProoffile[0] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 998199296 Shut down : N Username : MOBBO Date/Time : 17/05/2024 2:40:12 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : ~ Message : UpdateEkycdata StackTrace : tpDocimageforBank Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 542674944 Shut down : N Username : MOBBO Date/Time : 17/05/2024 3:03:13 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKIND1802Image170524031011.png$N$~ Message : UpdateEkycdata StackTrace : tpDocimageforBank Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 562958336 Shut down : N Username : MOBBO Date/Time : 17/05/2024 3:10:28 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKIND1802Image170524031011.png$N$ Message : UpdateEkycdata StackTrace : lcDocsrtring[i] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 563011584 Shut down : N Username : MOBBO Date/Time : 17/05/2024 3:10:28 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKIND1802Image170524031011.png Message : UpdateEkycdata StackTrace : lcProoffile[0] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 563011584 Shut down : N Username : MOBBO Date/Time : 17/05/2024 3:10:28 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKR6760012Image170524031323.png$N$~ Message : UpdateEkycdata StackTrace : tpDocimageforBank Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 567697408 Shut down : N Username : MOBBO Date/Time : 17/05/2024 3:13:39 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKR6760012Image170524031323.png$N$ Message : UpdateEkycdata StackTrace : lcDocsrtring[i] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 567713792 Shut down : N Username : MOBBO Date/Time : 17/05/2024 3:13:39 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKR6760012Image170524031323.png Message : UpdateEkycdata StackTrace : lcProoffile[0] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 567713792 Shut down : N Username : MOBBO Date/Time : 17/05/2024 3:13:39 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : Message : UpdateEkycdata StackTrace : tpDocimageforBank Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 811528192 Shut down : N Username : MOBBO Date/Time : 17/05/2024 3:20:13 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKS0500727Image170524034118.png$N$~ Message : UpdateEkycdata StackTrace : tpDocimageforBank Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 955174912 Shut down : N Username : MOBBO Date/Time : 17/05/2024 3:42:05 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKS0500727Image170524034118.png$N$ Message : UpdateEkycdata StackTrace : lcDocsrtring[i] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 955191296 Shut down : N Username : MOBBO Date/Time : 17/05/2024 3:42:05 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKS0500727Image170524034118.png Message : UpdateEkycdata StackTrace : lcProoffile[0] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 955191296 Shut down : N Username : MOBBO Date/Time : 17/05/2024 3:42:05 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Select tblFirmcreation.cshortname as cShortname From tblFirmcreation tblFirmcreation Where tblFirmcreation.cUserFirmcode='NBS-000001' Title : 01~Error Description : Value cannot be null. Parameter name: dataTable Method : AgeingacrossyearLine : 46316 Message : Ageingacrossyear StackTrace : at System.Data.Common.DataAdapter.Fill(DataTable[] dataTables, IDataReader dataReader, Int32 startRecord, Int32 maxRecords) at Oracle.ManagedDataAccess.Client.OracleDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable) at clientlevel.Thinclientlevel.Clientlogin.Ageingacrossyear(DateTime tdTransactiondate, Int32 tnTotaldays1, Int32 tnTotaldays2, Int32 tnTotaldays3, Int32 tnAngleselection, Int32 tnTotaldays4, Int32 tnTotaldays5, Int32 tnTotaldays6, Cliole loLdcommon, Int32 tnTotaldays7, Int32 tnTotaldays8, Int32 tnTotaldays9, Int32 tnTotaldays10, Int32 tnTotaldays11, Int32 tnTotaldays12, Int32 tnIncludepreviousyear, Int32 tnIgnorebounced, Int32 tnonlyReconciledentries, Int32 tnTerminalcodejoin, String& tcCashpayindate, String& tcFopayindate, Int32 tnAgeingonTransactiondate, String tcClientcode, Double tnAmount, String& tcSebiageingdate) in File25:line 46316 Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 360837120 Shut down : N Username : MOBBO Date/Time : 17/05/2024 3:43:51 PM Connection : Closed =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKS3030286Image170524035125.png$N$~ Message : UpdateEkycdata StackTrace : tpDocimageforBank Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 1026633728 Shut down : N Username : MOBBO Date/Time : 17/05/2024 3:52:13 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKS3030286Image170524035125.png$N$ Message : UpdateEkycdata StackTrace : lcDocsrtring[i] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 1026633728 Shut down : N Username : MOBBO Date/Time : 17/05/2024 3:52:13 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKS3030286Image170524035125.png Message : UpdateEkycdata StackTrace : lcProoffile[0] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 1026633728 Shut down : N Username : MOBBO Date/Time : 17/05/2024 3:52:13 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Select tblFirmcreation.cshortname as cShortname From tblFirmcreation tblFirmcreation Where tblFirmcreation.cUserFirmcode='NBS-000001' Title : 01~Error Description : Value cannot be null. Parameter name: dataTable Method : AgeingacrossyearLine : 46316 Message : Ageingacrossyear StackTrace : at System.Data.Common.DataAdapter.Fill(DataTable[] dataTables, IDataReader dataReader, Int32 startRecord, Int32 maxRecords) at Oracle.ManagedDataAccess.Client.OracleDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable) at clientlevel.Thinclientlevel.Clientlogin.Ageingacrossyear(DateTime tdTransactiondate, Int32 tnTotaldays1, Int32 tnTotaldays2, Int32 tnTotaldays3, Int32 tnAngleselection, Int32 tnTotaldays4, Int32 tnTotaldays5, Int32 tnTotaldays6, Cliole loLdcommon, Int32 tnTotaldays7, Int32 tnTotaldays8, Int32 tnTotaldays9, Int32 tnTotaldays10, Int32 tnTotaldays11, Int32 tnTotaldays12, Int32 tnIncludepreviousyear, Int32 tnIgnorebounced, Int32 tnonlyReconciledentries, Int32 tnTerminalcodejoin, String& tcCashpayindate, String& tcFopayindate, Int32 tnAgeingonTransactiondate, String tcClientcode, Double tnAmount, String& tcSebiageingdate) in File25:line 46316 Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 879431680 Shut down : N Username : MOBBO Date/Time : 17/05/2024 3:57:58 PM Connection : Closed =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKJJR6785Image170524035900.png$N$~ Message : UpdateEkycdata StackTrace : tpDocimageforBank Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 962580480 Shut down : N Username : MOBBO Date/Time : 17/05/2024 4:00:07 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKJJR6785Image170524035900.png$N$ Message : UpdateEkycdata StackTrace : lcDocsrtring[i] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 962580480 Shut down : N Username : MOBBO Date/Time : 17/05/2024 4:00:07 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKJJR6785Image170524035900.png Message : UpdateEkycdata StackTrace : lcProoffile[0] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 962580480 Shut down : N Username : MOBBO Date/Time : 17/05/2024 4:00:07 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKD1203523Image170524041031.png$N$~ Message : UpdateEkycdata StackTrace : tpDocimageforBank Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 333512704 Shut down : N Username : MOBBO Date/Time : 17/05/2024 4:12:53 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKD1203523Image170524041031.png$N$ Message : UpdateEkycdata StackTrace : lcDocsrtring[i] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 333553664 Shut down : N Username : MOBBO Date/Time : 17/05/2024 4:12:53 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKD1203523Image170524041031.png Message : UpdateEkycdata StackTrace : lcProoffile[0] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 333578240 Shut down : N Username : MOBBO Date/Time : 17/05/2024 4:12:53 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKNBL007Image170524041534.png$N$~ Message : UpdateEkycdata StackTrace : tpDocimageforBank Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 959365120 Shut down : N Username : MOBBO Date/Time : 17/05/2024 4:16:17 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKNBL007Image170524041534.png$N$ Message : UpdateEkycdata StackTrace : lcDocsrtring[i] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 959365120 Shut down : N Username : MOBBO Date/Time : 17/05/2024 4:16:17 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKNBL007Image170524041534.png Message : UpdateEkycdata StackTrace : lcProoffile[0] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 959365120 Shut down : N Username : MOBBO Date/Time : 17/05/2024 4:16:17 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKNIC012Image170524045411.png$N$~ Message : UpdateEkycdata StackTrace : tpDocimageforBank Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 783761408 Shut down : N Username : MOBBO Date/Time : 17/05/2024 4:55:20 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKNIC012Image170524045411.png$N$ Message : UpdateEkycdata StackTrace : lcDocsrtring[i] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 783777792 Shut down : N Username : MOBBO Date/Time : 17/05/2024 4:55:20 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKNIC012Image170524045411.png Message : UpdateEkycdata StackTrace : lcProoffile[0] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 783777792 Shut down : N Username : MOBBO Date/Time : 17/05/2024 4:55:20 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKT1760009Image170524045921.png$N$~ Message : UpdateEkycdata StackTrace : tpDocimageforBank Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 730267648 Shut down : N Username : MOBBO Date/Time : 17/05/2024 5:00:25 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKT1760009Image170524045921.png$N$ Message : UpdateEkycdata StackTrace : lcDocsrtring[i] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 730267648 Shut down : N Username : MOBBO Date/Time : 17/05/2024 5:00:25 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKT1760009Image170524045921.png Message : UpdateEkycdata StackTrace : lcProoffile[0] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 730267648 Shut down : N Username : MOBBO Date/Time : 17/05/2024 5:00:25 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKNIC012Image170524045411.png$N$~ Message : UpdateEkycdata StackTrace : tpDocimageforBank Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 732073984 Shut down : N Username : MOBBO Date/Time : 17/05/2024 5:04:26 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKNIC012Image170524045411.png$N$ Message : UpdateEkycdata StackTrace : lcDocsrtring[i] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 732090368 Shut down : N Username : MOBBO Date/Time : 17/05/2024 5:04:26 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKNIC012Image170524045411.png Message : UpdateEkycdata StackTrace : lcProoffile[0] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 732090368 Shut down : N Username : MOBBO Date/Time : 17/05/2024 5:04:26 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Select tblFirmcreation.cshortname as cShortname From tblFirmcreation tblFirmcreation Where tblFirmcreation.cUserFirmcode='NBS-000001' Title : 01~Error Description : Value cannot be null. Parameter name: dataTable Method : AgeingacrossyearLine : 46316 Message : Ageingacrossyear StackTrace : at System.Data.Common.DataAdapter.Fill(DataTable[] dataTables, IDataReader dataReader, Int32 startRecord, Int32 maxRecords) at Oracle.ManagedDataAccess.Client.OracleDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable) at clientlevel.Thinclientlevel.Clientlogin.Ageingacrossyear(DateTime tdTransactiondate, Int32 tnTotaldays1, Int32 tnTotaldays2, Int32 tnTotaldays3, Int32 tnAngleselection, Int32 tnTotaldays4, Int32 tnTotaldays5, Int32 tnTotaldays6, Cliole loLdcommon, Int32 tnTotaldays7, Int32 tnTotaldays8, Int32 tnTotaldays9, Int32 tnTotaldays10, Int32 tnTotaldays11, Int32 tnTotaldays12, Int32 tnIncludepreviousyear, Int32 tnIgnorebounced, Int32 tnonlyReconciledentries, Int32 tnTerminalcodejoin, String& tcCashpayindate, String& tcFopayindate, Int32 tnAgeingonTransactiondate, String tcClientcode, Double tnAmount, String& tcSebiageingdate) in File25:line 46316 Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 986988544 Shut down : N Username : MOBBO Date/Time : 17/05/2024 5:07:12 PM Connection : Closed =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Select tblFirmcreation.cshortname as cShortname From tblFirmcreation tblFirmcreation Where tblFirmcreation.cUserFirmcode='NBS-000001' Title : 01~Error Description : Value cannot be null. Parameter name: dataTable Method : AgeingacrossyearLine : 46316 Message : Ageingacrossyear StackTrace : at System.Data.Common.DataAdapter.Fill(DataTable[] dataTables, IDataReader dataReader, Int32 startRecord, Int32 maxRecords) at Oracle.ManagedDataAccess.Client.OracleDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable) at clientlevel.Thinclientlevel.Clientlogin.Ageingacrossyear(DateTime tdTransactiondate, Int32 tnTotaldays1, Int32 tnTotaldays2, Int32 tnTotaldays3, Int32 tnAngleselection, Int32 tnTotaldays4, Int32 tnTotaldays5, Int32 tnTotaldays6, Cliole loLdcommon, Int32 tnTotaldays7, Int32 tnTotaldays8, Int32 tnTotaldays9, Int32 tnTotaldays10, Int32 tnTotaldays11, Int32 tnTotaldays12, Int32 tnIncludepreviousyear, Int32 tnIgnorebounced, Int32 tnonlyReconciledentries, Int32 tnTerminalcodejoin, String& tcCashpayindate, String& tcFopayindate, Int32 tnAgeingonTransactiondate, String tcClientcode, Double tnAmount, String& tcSebiageingdate) in File25:line 46316 Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 918208512 Shut down : N Username : MOBBO Date/Time : 17/05/2024 5:08:10 PM Connection : Closed =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKS0100563Image170524050817.png$N$~ Message : UpdateEkycdata StackTrace : tpDocimageforBank Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 917467136 Shut down : N Username : MOBBO Date/Time : 17/05/2024 5:09:00 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKS0100563Image170524050817.png$N$ Message : UpdateEkycdata StackTrace : lcDocsrtring[i] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 917467136 Shut down : N Username : MOBBO Date/Time : 17/05/2024 5:09:00 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKS0100563Image170524050817.png Message : UpdateEkycdata StackTrace : lcProoffile[0] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 917467136 Shut down : N Username : MOBBO Date/Time : 17/05/2024 5:09:00 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Merge into tblCCMekycbankchqrmkr@lnk_ccm T1 using ( Select 'NBS-000001' as cFirmnumber, 'S0100563' as cClientcode,34144 as nEkycrefno from dual ) T2 on (T1.cFirmnumber=T2.cFirmnumber and T1.cClientcode=T2.cClientcode and T1.nEkycdoucmentno=T2.nEkycrefno) when matched then update set cBankcode='2375',cBankname='ESAF SMALL FINANCE BANK',cIfsccode='ESMF0001332',cMicrcode='689760052',cBranchname='ALAPPUZ',cBankacno='53240000917964', cChqprintname='ABRAHAM THOMAS', cbankactype='Savings', cDefaultbank='Y', dApiverificationstart=to_date('17/05/2024 17:08:46','dd/MM/yyyy hh24:mi:ss'),dApiresponcerecd=sysdate,cApiresponceid='XGT4PXNLM7DV3RR', cNameasperresponce='Abraham Thomas',cMaker='36GKk/aKlFvyOPfFvyBctA==' when not matched then Insert (cFirmnumber,cClientcode,nEkycdoucmentno,cBankcode,cBankname,cIfsccode,cMicrcode,cBranchname,cBankacno,cChqprintname, cbankactype,cDefaultbank, dApiverificationstart,dApiresponcerecd,cApiresponceid,cNameasperresponce,cMaker,cChecker) Values ('NBS-000001', 'S0100563',34144,'2375','ESAF SMALL FINANCE BANK','ESMF0001332','689760052','ALAPPUZ','53240000917964','ABRAHAM THOMAS', 'Savings', 'Y', to_date('17/05/2024 17:08:46','dd/MM/yyyy hh24:mi:ss'),sysdate,'XGT4PXNLM7DV3RR','Abraham Thomas','36GKk/aKlFvyOPfFvyBctA==',' ') Title : 01~Error Description : Could not find file 'D:\Inetpub\wwwroot\LdMobileService\EkycDocimages\BANKS0100563Image170524050817.png'. Method : UpdateEkycdataLine : 71449 Message : UpdateEkycdata StackTrace : at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) at System.IO.File.InternalReadAllBytes(String path, Boolean checkHost) at ekyc.ekycdata.UpdateEkycdata(Cliole loLdcommon, Int32 tnAngleselection, String tcClientcode, String tcRequstType, String tcMobile, String tcEmailaddress, String tcClientname, String tcFirstname, String tcSecondname, String tcLastname, String tcCorraddressline1, String tcCorraddressline2, String tcCorraddressline3, String tcCorraddresscity, String tnCorrpin, String tcCorrstate, String tcCorrstateother, String tcCorrcountry, String tcCorraddressproof, String tcCorraddressrefid, String tdCorraddressproofissuedt, String tdCorraddressproofexpirydt, String tcPfraddressline1, String tcPfraddressline2, String tcPfraddressline3, String tcPfraddresscity, Int32 tnPfrpin, String tcPfrstate, String tcPfrstateother, String tcPfrcountry, String tcPfraddressproof, String tcPfraddressproofrefid, String tdPfraddressproofissuedt, String tdPfraddressproofexpirydt, String tcResdstatuscode, String tcGender, String tcMaritalstatus, String tcFatherSpousename, String tcNationality, String tcPrefixmaidenname, String tcApplicantMaidenname, String tcPrefixfatherspouse, String tcPrefixmothername, String tcMothername, String tcMothermaidenname, String tcFatcaProofofaddress, String tcFatcaIdnumber, String tcFatcataxresidence, String tcCountryofbirth, String tcCityofbirth, Int64 tnAnnualincome, Int64 tnNetworth, String tdNetworth, String tcDeviceinfo, Int32 tnUpdateKYC, Int32 tnUpdateaddress, Int32 tnUpadateFatca, Int32 tnUpdateMobile, Int32 tnUpdateemail, Int32 tnUpdateBank, Int32 tnUpdateDemat, String tcUserid, String tcFatherHusbandflag, String tpDocimageforAddress, String tpDocimageforKYC, String tpDocimageforFatca, String tcBankdetails, String tpDocimageforBank, String tcDematdetails, String tpDocimageforDemat, String tcOccupation, String tcEsigneddoneby, Int64& tnEkycDocumentno, String tcFilepath, String tcAddressasperKyc, Int64 tnEkycreferenceno, String tcUseraction, String tcIdentifier, String tcEsignPdffilename, String& tceSigndocumentid, Cliole loCCMcon, String tcEsignmethod, String tcEmailFamily, String tcEconfirmation, String tcMobilefamily, Int32 tnUpdateOtherdetails, String tdDOB, String tcAadharnumber, String tceducation, String tcInternettradingflag, String tcDPfees, String tcIBTdetails, String tcIPVproofdetails, String tcDepository, Int32 tnInternetsoftware, String tcKRAAddressIPV, Boolean tlEsignwithClientname, Int32 tnUpdatenominee, String tcNomineedetails, String tcNomineeproof, String tcClientSignaturefile, String tcNomineeopted, String tcNomineeoptout, Int32 tnUpdateSegment, String tcSegmentActivationdetails, String tcSegmentDeActivationdetails, String tcSegmentproofdetails, String tcSchemecode, String tcEsigncoordinator, String tcsubcategoryforcomm, String tcCommodiyitemlist, String tcDerConsentgiven) in File25:line 71449 Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 917598208 Shut down : N Username : MOBBO Date/Time : 17/05/2024 5:09:00 PM Connection : Closed =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Select tblFirmcreation.cshortname as cShortname From tblFirmcreation tblFirmcreation Where tblFirmcreation.cUserFirmcode='NBS-000001' Title : 01~Error Description : Value cannot be null. Parameter name: dataTable Method : AgeingacrossyearLine : 46316 Message : Ageingacrossyear StackTrace : at System.Data.Common.DataAdapter.Fill(DataTable[] dataTables, IDataReader dataReader, Int32 startRecord, Int32 maxRecords) at Oracle.ManagedDataAccess.Client.OracleDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable) at clientlevel.Thinclientlevel.Clientlogin.Ageingacrossyear(DateTime tdTransactiondate, Int32 tnTotaldays1, Int32 tnTotaldays2, Int32 tnTotaldays3, Int32 tnAngleselection, Int32 tnTotaldays4, Int32 tnTotaldays5, Int32 tnTotaldays6, Cliole loLdcommon, Int32 tnTotaldays7, Int32 tnTotaldays8, Int32 tnTotaldays9, Int32 tnTotaldays10, Int32 tnTotaldays11, Int32 tnTotaldays12, Int32 tnIncludepreviousyear, Int32 tnIgnorebounced, Int32 tnonlyReconciledentries, Int32 tnTerminalcodejoin, String& tcCashpayindate, String& tcFopayindate, Int32 tnAgeingonTransactiondate, String tcClientcode, Double tnAmount, String& tcSebiageingdate) in File25:line 46316 Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 928501760 Shut down : N Username : MOBBO Date/Time : 17/05/2024 5:10:55 PM Connection : Closed =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKS0100563Image170524050817.png$N$~ Message : UpdateEkycdata StackTrace : tpDocimageforBank Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 876572672 Shut down : N Username : MOBBO Date/Time : 17/05/2024 5:11:33 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKS0100563Image170524050817.png$N$ Message : UpdateEkycdata StackTrace : lcDocsrtring[i] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 876572672 Shut down : N Username : MOBBO Date/Time : 17/05/2024 5:11:33 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKS0100563Image170524050817.png Message : UpdateEkycdata StackTrace : lcProoffile[0] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 876572672 Shut down : N Username : MOBBO Date/Time : 17/05/2024 5:11:33 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Merge into tblCCMekycbankchqrmkr@lnk_ccm T1 using ( Select 'NBS-000001' as cFirmnumber, 'S0100563' as cClientcode,34145 as nEkycrefno from dual ) T2 on (T1.cFirmnumber=T2.cFirmnumber and T1.cClientcode=T2.cClientcode and T1.nEkycdoucmentno=T2.nEkycrefno) when matched then update set cBankcode='2375',cBankname='ESAF SMALL FINANCE BANK',cIfsccode='ESMF0001332',cMicrcode='689760052',cBranchname='ALAPPUZ',cBankacno='53240000917964', cChqprintname='ABRAHAM THOMAS', cbankactype='Savings', cDefaultbank='Y', dApiverificationstart=to_date('17/05/2024 17:08:46','dd/MM/yyyy hh24:mi:ss'),dApiresponcerecd=sysdate,cApiresponceid='XGT4PXNLM7DV3RR', cNameasperresponce='Abraham Thomas',cMaker='36GKk/aKlFvyOPfFvyBctA==' when not matched then Insert (cFirmnumber,cClientcode,nEkycdoucmentno,cBankcode,cBankname,cIfsccode,cMicrcode,cBranchname,cBankacno,cChqprintname, cbankactype,cDefaultbank, dApiverificationstart,dApiresponcerecd,cApiresponceid,cNameasperresponce,cMaker,cChecker) Values ('NBS-000001', 'S0100563',34145,'2375','ESAF SMALL FINANCE BANK','ESMF0001332','689760052','ALAPPUZ','53240000917964','ABRAHAM THOMAS', 'Savings', 'Y', to_date('17/05/2024 17:08:46','dd/MM/yyyy hh24:mi:ss'),sysdate,'XGT4PXNLM7DV3RR','Abraham Thomas','36GKk/aKlFvyOPfFvyBctA==',' ') Title : 01~Error Description : Could not find file 'D:\Inetpub\wwwroot\LdMobileService\EkycDocimages\BANKS0100563Image170524050817.png'. Method : UpdateEkycdataLine : 71449 Message : UpdateEkycdata StackTrace : at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) at System.IO.File.InternalReadAllBytes(String path, Boolean checkHost) at ekyc.ekycdata.UpdateEkycdata(Cliole loLdcommon, Int32 tnAngleselection, String tcClientcode, String tcRequstType, String tcMobile, String tcEmailaddress, String tcClientname, String tcFirstname, String tcSecondname, String tcLastname, String tcCorraddressline1, String tcCorraddressline2, String tcCorraddressline3, String tcCorraddresscity, String tnCorrpin, String tcCorrstate, String tcCorrstateother, String tcCorrcountry, String tcCorraddressproof, String tcCorraddressrefid, String tdCorraddressproofissuedt, String tdCorraddressproofexpirydt, String tcPfraddressline1, String tcPfraddressline2, String tcPfraddressline3, String tcPfraddresscity, Int32 tnPfrpin, String tcPfrstate, String tcPfrstateother, String tcPfrcountry, String tcPfraddressproof, String tcPfraddressproofrefid, String tdPfraddressproofissuedt, String tdPfraddressproofexpirydt, String tcResdstatuscode, String tcGender, String tcMaritalstatus, String tcFatherSpousename, String tcNationality, String tcPrefixmaidenname, String tcApplicantMaidenname, String tcPrefixfatherspouse, String tcPrefixmothername, String tcMothername, String tcMothermaidenname, String tcFatcaProofofaddress, String tcFatcaIdnumber, String tcFatcataxresidence, String tcCountryofbirth, String tcCityofbirth, Int64 tnAnnualincome, Int64 tnNetworth, String tdNetworth, String tcDeviceinfo, Int32 tnUpdateKYC, Int32 tnUpdateaddress, Int32 tnUpadateFatca, Int32 tnUpdateMobile, Int32 tnUpdateemail, Int32 tnUpdateBank, Int32 tnUpdateDemat, String tcUserid, String tcFatherHusbandflag, String tpDocimageforAddress, String tpDocimageforKYC, String tpDocimageforFatca, String tcBankdetails, String tpDocimageforBank, String tcDematdetails, String tpDocimageforDemat, String tcOccupation, String tcEsigneddoneby, Int64& tnEkycDocumentno, String tcFilepath, String tcAddressasperKyc, Int64 tnEkycreferenceno, String tcUseraction, String tcIdentifier, String tcEsignPdffilename, String& tceSigndocumentid, Cliole loCCMcon, String tcEsignmethod, String tcEmailFamily, String tcEconfirmation, String tcMobilefamily, Int32 tnUpdateOtherdetails, String tdDOB, String tcAadharnumber, String tceducation, String tcInternettradingflag, String tcDPfees, String tcIBTdetails, String tcIPVproofdetails, String tcDepository, Int32 tnInternetsoftware, String tcKRAAddressIPV, Boolean tlEsignwithClientname, Int32 tnUpdatenominee, String tcNomineedetails, String tcNomineeproof, String tcClientSignaturefile, String tcNomineeopted, String tcNomineeoptout, Int32 tnUpdateSegment, String tcSegmentActivationdetails, String tcSegmentDeActivationdetails, String tcSegmentproofdetails, String tcSchemecode, String tcEsigncoordinator, String tcsubcategoryforcomm, String tcCommodiyitemlist, String tcDerConsentgiven) in File25:line 71449 Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 876572672 Shut down : N Username : MOBBO Date/Time : 17/05/2024 5:11:33 PM Connection : Closed =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Select tblFirmcreation.cshortname as cShortname From tblFirmcreation tblFirmcreation Where tblFirmcreation.cUserFirmcode='NBS-000001' Title : 01~Error Description : Value cannot be null. Parameter name: dataTable Method : AgeingacrossyearLine : 46316 Message : Ageingacrossyear StackTrace : at System.Data.Common.DataAdapter.Fill(DataTable[] dataTables, IDataReader dataReader, Int32 startRecord, Int32 maxRecords) at Oracle.ManagedDataAccess.Client.OracleDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable) at clientlevel.Thinclientlevel.Clientlogin.Ageingacrossyear(DateTime tdTransactiondate, Int32 tnTotaldays1, Int32 tnTotaldays2, Int32 tnTotaldays3, Int32 tnAngleselection, Int32 tnTotaldays4, Int32 tnTotaldays5, Int32 tnTotaldays6, Cliole loLdcommon, Int32 tnTotaldays7, Int32 tnTotaldays8, Int32 tnTotaldays9, Int32 tnTotaldays10, Int32 tnTotaldays11, Int32 tnTotaldays12, Int32 tnIncludepreviousyear, Int32 tnIgnorebounced, Int32 tnonlyReconciledentries, Int32 tnTerminalcodejoin, String& tcCashpayindate, String& tcFopayindate, Int32 tnAgeingonTransactiondate, String tcClientcode, Double tnAmount, String& tcSebiageingdate) in File25:line 46316 Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 582742016 Shut down : N Username : MOBBO Date/Time : 17/05/2024 5:13:56 PM Connection : Closed =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKLKN1843Image170524051518.png$N$~ Message : UpdateEkycdata StackTrace : tpDocimageforBank Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 894111744 Shut down : N Username : MOBBO Date/Time : 17/05/2024 5:15:36 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKLKN1843Image170524051518.png$N$ Message : UpdateEkycdata StackTrace : lcDocsrtring[i] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 894111744 Shut down : N Username : MOBBO Date/Time : 17/05/2024 5:15:36 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKLKN1843Image170524051518.png Message : UpdateEkycdata StackTrace : lcProoffile[0] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 894111744 Shut down : N Username : MOBBO Date/Time : 17/05/2024 5:15:36 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKJPK094Image170524053419.png$N$~ Message : UpdateEkycdata StackTrace : tpDocimageforBank Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 662994944 Shut down : N Username : MOBBO Date/Time : 17/05/2024 5:34:37 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKJPK094Image170524053419.png$N$ Message : UpdateEkycdata StackTrace : lcDocsrtring[i] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 663035904 Shut down : N Username : MOBBO Date/Time : 17/05/2024 5:34:37 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKJPK094Image170524053419.png Message : UpdateEkycdata StackTrace : lcProoffile[0] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 663060480 Shut down : N Username : MOBBO Date/Time : 17/05/2024 5:34:37 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : Message : UpdateEkycdata StackTrace : tpDocimageforBank Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 901955584 Shut down : N Username : MOBBO Date/Time : 17/05/2024 5:42:14 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKS0100563Image170524054650.png$N$~ Message : UpdateEkycdata StackTrace : tpDocimageforBank Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 866586624 Shut down : N Username : MOBBO Date/Time : 17/05/2024 5:47:07 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKS0100563Image170524054650.png$N$ Message : UpdateEkycdata StackTrace : lcDocsrtring[i] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 866603008 Shut down : N Username : MOBBO Date/Time : 17/05/2024 5:47:07 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKS0100563Image170524054650.png Message : UpdateEkycdata StackTrace : lcProoffile[0] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 866603008 Shut down : N Username : MOBBO Date/Time : 17/05/2024 5:47:07 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKSML038Image170524054647.png$N$~ Message : UpdateEkycdata StackTrace : tpDocimageforBank Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 953626624 Shut down : N Username : MOBBO Date/Time : 17/05/2024 5:47:47 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKSML038Image170524054647.png$N$ Message : UpdateEkycdata StackTrace : lcDocsrtring[i] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 953626624 Shut down : N Username : MOBBO Date/Time : 17/05/2024 5:47:47 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKSML038Image170524054647.png Message : UpdateEkycdata StackTrace : lcProoffile[0] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 953626624 Shut down : N Username : MOBBO Date/Time : 17/05/2024 5:47:47 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKR6760012Image170524060244.png$N$~ Message : UpdateEkycdata StackTrace : tpDocimageforBank Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 366047232 Shut down : N Username : MOBBO Date/Time : 17/05/2024 6:02:58 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKR6760012Image170524060244.png$N$ Message : UpdateEkycdata StackTrace : lcDocsrtring[i] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 366063616 Shut down : N Username : MOBBO Date/Time : 17/05/2024 6:02:58 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKR6760012Image170524060244.png Message : UpdateEkycdata StackTrace : lcProoffile[0] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 366063616 Shut down : N Username : MOBBO Date/Time : 17/05/2024 6:02:58 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : 01~Error Description : ORA-02291: integrity constraint (LDBO.FK_CLIENTBANK) violated - parent key not found Method : PaymentReq_SaveLine : 36368 Message : Paymentrequest_save StackTrace : at OracleInternal.ServiceObjects.OracleConnectionImpl.VerifyExecution(Int32& cursorId, Boolean bThrowArrayBindRelatedErrors, SqlStatementType sqlStatementType, Int32 arrayBindCount, OracleException& exceptionForArrayBindDML, Boolean& hasMoreRowsInDB, Boolean bFirstIterationDone) at OracleInternal.ServiceObjects.OracleCommandImpl.ExecuteNonQuery(String commandText, OracleParameterCollection paramColl, CommandType commandType, OracleConnectionImpl connectionImpl, Int32 longFetchSize, Int64 clientInitialLOBFS, OracleDependencyImpl orclDependencyImpl, Int64[]& scnFromExecution, OracleParameterCollection& bindByPositionParamColl, Boolean& bBindParamPresent, OracleException& exceptionForArrayBindDML, OracleConnection connection, OracleLogicalTransaction& oracleLogicalTransaction, Boolean isFromEF) at Oracle.ManagedDataAccess.Client.OracleCommand.ExecuteNonQuery() at clientlevel.Thinclientlevel.Clientlogin.PaymentReq_Save(String tcPaymentRequestXmlFile, String tcFilePath, Int32 tnProductCode, String tcEntryMethod, Cliole loLdcommon, String tcClientcode) in File25:line 36368 Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 677957632 Shut down : N Username : MOBBO Date/Time : 17/05/2024 6:35:24 PM Connection : Closed =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : 01~Error Description : ORA-02291: integrity constraint (LDBO.FK_CLIENTBANK) violated - parent key not found Method : PaymentReq_SaveLine : 36368 Message : Paymentrequest_save StackTrace : at OracleInternal.ServiceObjects.OracleConnectionImpl.VerifyExecution(Int32& cursorId, Boolean bThrowArrayBindRelatedErrors, SqlStatementType sqlStatementType, Int32 arrayBindCount, OracleException& exceptionForArrayBindDML, Boolean& hasMoreRowsInDB, Boolean bFirstIterationDone) at OracleInternal.ServiceObjects.OracleCommandImpl.ExecuteNonQuery(String commandText, OracleParameterCollection paramColl, CommandType commandType, OracleConnectionImpl connectionImpl, Int32 longFetchSize, Int64 clientInitialLOBFS, OracleDependencyImpl orclDependencyImpl, Int64[]& scnFromExecution, OracleParameterCollection& bindByPositionParamColl, Boolean& bBindParamPresent, OracleException& exceptionForArrayBindDML, OracleConnection connection, OracleLogicalTransaction& oracleLogicalTransaction, Boolean isFromEF) at Oracle.ManagedDataAccess.Client.OracleCommand.ExecuteNonQuery() at clientlevel.Thinclientlevel.Clientlogin.PaymentReq_Save(String tcPaymentRequestXmlFile, String tcFilePath, Int32 tnProductCode, String tcEntryMethod, Cliole loLdcommon, String tcClientcode) in File25:line 36368 Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 680615936 Shut down : N Username : MOBBO Date/Time : 17/05/2024 6:35:33 PM Connection : Closed =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : 01~Error Description : ORA-02291: integrity constraint (LDBO.FK_CLIENTBANK) violated - parent key not found Method : PaymentReq_SaveLine : 36368 Message : Paymentrequest_save StackTrace : at OracleInternal.ServiceObjects.OracleConnectionImpl.VerifyExecution(Int32& cursorId, Boolean bThrowArrayBindRelatedErrors, SqlStatementType sqlStatementType, Int32 arrayBindCount, OracleException& exceptionForArrayBindDML, Boolean& hasMoreRowsInDB, Boolean bFirstIterationDone) at OracleInternal.ServiceObjects.OracleCommandImpl.ExecuteNonQuery(String commandText, OracleParameterCollection paramColl, CommandType commandType, OracleConnectionImpl connectionImpl, Int32 longFetchSize, Int64 clientInitialLOBFS, OracleDependencyImpl orclDependencyImpl, Int64[]& scnFromExecution, OracleParameterCollection& bindByPositionParamColl, Boolean& bBindParamPresent, OracleException& exceptionForArrayBindDML, OracleConnection connection, OracleLogicalTransaction& oracleLogicalTransaction, Boolean isFromEF) at Oracle.ManagedDataAccess.Client.OracleCommand.ExecuteNonQuery() at clientlevel.Thinclientlevel.Clientlogin.PaymentReq_Save(String tcPaymentRequestXmlFile, String tcFilePath, Int32 tnProductCode, String tcEntryMethod, Cliole loLdcommon, String tcClientcode) in File25:line 36368 Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 634347520 Shut down : N Username : MOBBO Date/Time : 17/05/2024 6:36:30 PM Connection : Closed =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : 01~Error Description : ORA-02291: integrity constraint (LDBO.FK_CLIENTBANK) violated - parent key not found Method : PaymentReq_SaveLine : 36368 Message : Paymentrequest_save StackTrace : at OracleInternal.ServiceObjects.OracleConnectionImpl.VerifyExecution(Int32& cursorId, Boolean bThrowArrayBindRelatedErrors, SqlStatementType sqlStatementType, Int32 arrayBindCount, OracleException& exceptionForArrayBindDML, Boolean& hasMoreRowsInDB, Boolean bFirstIterationDone) at OracleInternal.ServiceObjects.OracleCommandImpl.ExecuteNonQuery(String commandText, OracleParameterCollection paramColl, CommandType commandType, OracleConnectionImpl connectionImpl, Int32 longFetchSize, Int64 clientInitialLOBFS, OracleDependencyImpl orclDependencyImpl, Int64[]& scnFromExecution, OracleParameterCollection& bindByPositionParamColl, Boolean& bBindParamPresent, OracleException& exceptionForArrayBindDML, OracleConnection connection, OracleLogicalTransaction& oracleLogicalTransaction, Boolean isFromEF) at Oracle.ManagedDataAccess.Client.OracleCommand.ExecuteNonQuery() at clientlevel.Thinclientlevel.Clientlogin.PaymentReq_Save(String tcPaymentRequestXmlFile, String tcFilePath, Int32 tnProductCode, String tcEntryMethod, Cliole loLdcommon, String tcClientcode) in File25:line 36368 Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 723447808 Shut down : N Username : MOBBO Date/Time : 17/05/2024 6:36:40 PM Connection : Closed =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : 01~Error Description : ORA-02291: integrity constraint (LDBO.FK_CLIENTBANK) violated - parent key not found Method : PaymentReq_SaveLine : 36368 Message : Paymentrequest_save StackTrace : at OracleInternal.ServiceObjects.OracleConnectionImpl.VerifyExecution(Int32& cursorId, Boolean bThrowArrayBindRelatedErrors, SqlStatementType sqlStatementType, Int32 arrayBindCount, OracleException& exceptionForArrayBindDML, Boolean& hasMoreRowsInDB, Boolean bFirstIterationDone) at OracleInternal.ServiceObjects.OracleCommandImpl.ExecuteNonQuery(String commandText, OracleParameterCollection paramColl, CommandType commandType, OracleConnectionImpl connectionImpl, Int32 longFetchSize, Int64 clientInitialLOBFS, OracleDependencyImpl orclDependencyImpl, Int64[]& scnFromExecution, OracleParameterCollection& bindByPositionParamColl, Boolean& bBindParamPresent, OracleException& exceptionForArrayBindDML, OracleConnection connection, OracleLogicalTransaction& oracleLogicalTransaction, Boolean isFromEF) at Oracle.ManagedDataAccess.Client.OracleCommand.ExecuteNonQuery() at clientlevel.Thinclientlevel.Clientlogin.PaymentReq_Save(String tcPaymentRequestXmlFile, String tcFilePath, Int32 tnProductCode, String tcEntryMethod, Cliole loLdcommon, String tcClientcode) in File25:line 36368 Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 733085696 Shut down : N Username : MOBBO Date/Time : 17/05/2024 6:37:24 PM Connection : Closed =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Select tblFirmcreation.cshortname as cShortname From tblFirmcreation tblFirmcreation Where tblFirmcreation.cUserFirmcode='NBS-000001' Title : 01~Error Description : Value cannot be null. Parameter name: dataTable Method : AgeingacrossyearLine : 46316 Message : Ageingacrossyear StackTrace : at System.Data.Common.DataAdapter.Fill(DataTable[] dataTables, IDataReader dataReader, Int32 startRecord, Int32 maxRecords) at Oracle.ManagedDataAccess.Client.OracleDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable) at clientlevel.Thinclientlevel.Clientlogin.Ageingacrossyear(DateTime tdTransactiondate, Int32 tnTotaldays1, Int32 tnTotaldays2, Int32 tnTotaldays3, Int32 tnAngleselection, Int32 tnTotaldays4, Int32 tnTotaldays5, Int32 tnTotaldays6, Cliole loLdcommon, Int32 tnTotaldays7, Int32 tnTotaldays8, Int32 tnTotaldays9, Int32 tnTotaldays10, Int32 tnTotaldays11, Int32 tnTotaldays12, Int32 tnIncludepreviousyear, Int32 tnIgnorebounced, Int32 tnonlyReconciledentries, Int32 tnTerminalcodejoin, String& tcCashpayindate, String& tcFopayindate, Int32 tnAgeingonTransactiondate, String tcClientcode, Double tnAmount, String& tcSebiageingdate) in File25:line 46316 Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 777854976 Shut down : N Username : MOBBO Date/Time : 17/05/2024 6:49:21 PM Connection : Closed =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Select tblFirmcreation.cshortname as cShortname From tblFirmcreation tblFirmcreation Where tblFirmcreation.cUserFirmcode='NBS-000001' Title : 01~Error Description : Value cannot be null. Parameter name: dataTable Method : AgeingacrossyearLine : 46316 Message : Ageingacrossyear StackTrace : at System.Data.Common.DataAdapter.Fill(DataTable[] dataTables, IDataReader dataReader, Int32 startRecord, Int32 maxRecords) at Oracle.ManagedDataAccess.Client.OracleDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable) at clientlevel.Thinclientlevel.Clientlogin.Ageingacrossyear(DateTime tdTransactiondate, Int32 tnTotaldays1, Int32 tnTotaldays2, Int32 tnTotaldays3, Int32 tnAngleselection, Int32 tnTotaldays4, Int32 tnTotaldays5, Int32 tnTotaldays6, Cliole loLdcommon, Int32 tnTotaldays7, Int32 tnTotaldays8, Int32 tnTotaldays9, Int32 tnTotaldays10, Int32 tnTotaldays11, Int32 tnTotaldays12, Int32 tnIncludepreviousyear, Int32 tnIgnorebounced, Int32 tnonlyReconciledentries, Int32 tnTerminalcodejoin, String& tcCashpayindate, String& tcFopayindate, Int32 tnAgeingonTransactiondate, String tcClientcode, Double tnAmount, String& tcSebiageingdate) in File25:line 46316 Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 809984000 Shut down : N Username : MOBBO Date/Time : 17/05/2024 7:19:52 PM Connection : Closed =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKA2138807Image170524075515.png$N$~ Message : UpdateEkycdata StackTrace : tpDocimageforBank Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 831909888 Shut down : N Username : MOBBO Date/Time : 17/05/2024 7:56:15 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKA2138807Image170524075515.png$N$ Message : UpdateEkycdata StackTrace : lcDocsrtring[i] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 831926272 Shut down : N Username : MOBBO Date/Time : 17/05/2024 7:56:15 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKA2138807Image170524075515.png Message : UpdateEkycdata StackTrace : lcProoffile[0] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 831926272 Shut down : N Username : MOBBO Date/Time : 17/05/2024 7:56:15 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Merge into tblCCMekycbankchqrmkr@lnk_ccm T1 using ( Select 'NBS-000001' as cFirmnumber, 'A2138807' as cClientcode,34152 as nEkycrefno from dual ) T2 on (T1.cFirmnumber=T2.cFirmnumber and T1.cClientcode=T2.cClientcode and T1.nEkycdoucmentno=T2.nEkycrefno) when matched then update set cBankcode='501',cBankname='UNION BANK OF INDIA',cIfsccode='UBIN0913707',cMicrcode='364026072',cBranchname='SIHOR',cBankacno='137022010002745', cChqprintname='GOHIL BHAVNABEN KISHORBHAI', cbankactype='Savings', cDefaultbank='Y', dApiverificationstart=to_date('17/05/2024 19:56:03','dd/MM/yyyy hh24:mi:ss'),dApiresponcerecd=sysdate,cApiresponceid='', cNameasperresponce='GOHIL BHAVNABEN KISH',cMaker='XDjlkYmyGOnwW3Es3bxNkw==' when not matched then Insert (cFirmnumber,cClientcode,nEkycdoucmentno,cBankcode,cBankname,cIfsccode,cMicrcode,cBranchname,cBankacno,cChqprintname, cbankactype,cDefaultbank, dApiverificationstart,dApiresponcerecd,cApiresponceid,cNameasperresponce,cMaker,cChecker) Values ('NBS-000001', 'A2138807',34152,'501','UNION BANK OF INDIA','UBIN0913707','364026072','SIHOR','137022010002745','GOHIL BHAVNABEN KISHORBHAI', 'Savings', 'Y', to_date('17/05/2024 19:56:03','dd/MM/yyyy hh24:mi:ss'),sysdate,'','GOHIL BHAVNABEN KISH','XDjlkYmyGOnwW3Es3bxNkw==',' ') Title : 01~Error Description : Could not find file 'D:\Inetpub\wwwroot\LdMobileService\EkycDocimages\BANKA2138807Image170524075515.png'. Method : UpdateEkycdataLine : 71449 Message : UpdateEkycdata StackTrace : at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) at System.IO.File.InternalReadAllBytes(String path, Boolean checkHost) at ekyc.ekycdata.UpdateEkycdata(Cliole loLdcommon, Int32 tnAngleselection, String tcClientcode, String tcRequstType, String tcMobile, String tcEmailaddress, String tcClientname, String tcFirstname, String tcSecondname, String tcLastname, String tcCorraddressline1, String tcCorraddressline2, String tcCorraddressline3, String tcCorraddresscity, String tnCorrpin, String tcCorrstate, String tcCorrstateother, String tcCorrcountry, String tcCorraddressproof, String tcCorraddressrefid, String tdCorraddressproofissuedt, String tdCorraddressproofexpirydt, String tcPfraddressline1, String tcPfraddressline2, String tcPfraddressline3, String tcPfraddresscity, Int32 tnPfrpin, String tcPfrstate, String tcPfrstateother, String tcPfrcountry, String tcPfraddressproof, String tcPfraddressproofrefid, String tdPfraddressproofissuedt, String tdPfraddressproofexpirydt, String tcResdstatuscode, String tcGender, String tcMaritalstatus, String tcFatherSpousename, String tcNationality, String tcPrefixmaidenname, String tcApplicantMaidenname, String tcPrefixfatherspouse, String tcPrefixmothername, String tcMothername, String tcMothermaidenname, String tcFatcaProofofaddress, String tcFatcaIdnumber, String tcFatcataxresidence, String tcCountryofbirth, String tcCityofbirth, Int64 tnAnnualincome, Int64 tnNetworth, String tdNetworth, String tcDeviceinfo, Int32 tnUpdateKYC, Int32 tnUpdateaddress, Int32 tnUpadateFatca, Int32 tnUpdateMobile, Int32 tnUpdateemail, Int32 tnUpdateBank, Int32 tnUpdateDemat, String tcUserid, String tcFatherHusbandflag, String tpDocimageforAddress, String tpDocimageforKYC, String tpDocimageforFatca, String tcBankdetails, String tpDocimageforBank, String tcDematdetails, String tpDocimageforDemat, String tcOccupation, String tcEsigneddoneby, Int64& tnEkycDocumentno, String tcFilepath, String tcAddressasperKyc, Int64 tnEkycreferenceno, String tcUseraction, String tcIdentifier, String tcEsignPdffilename, String& tceSigndocumentid, Cliole loCCMcon, String tcEsignmethod, String tcEmailFamily, String tcEconfirmation, String tcMobilefamily, Int32 tnUpdateOtherdetails, String tdDOB, String tcAadharnumber, String tceducation, String tcInternettradingflag, String tcDPfees, String tcIBTdetails, String tcIPVproofdetails, String tcDepository, Int32 tnInternetsoftware, String tcKRAAddressIPV, Boolean tlEsignwithClientname, Int32 tnUpdatenominee, String tcNomineedetails, String tcNomineeproof, String tcClientSignaturefile, String tcNomineeopted, String tcNomineeoptout, Int32 tnUpdateSegment, String tcSegmentActivationdetails, String tcSegmentDeActivationdetails, String tcSegmentproofdetails, String tcSchemecode, String tcEsigncoordinator, String tcsubcategoryforcomm, String tcCommodiyitemlist, String tcDerConsentgiven) in File25:line 71449 Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 833388544 Shut down : N Username : MOBBO Date/Time : 17/05/2024 7:56:15 PM Connection : Closed =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Select tblFirmcreation.cshortname as cShortname From tblFirmcreation tblFirmcreation Where tblFirmcreation.cUserFirmcode='NBS-000001' Title : 01~Error Description : Value cannot be null. Parameter name: dataTable Method : AgeingacrossyearLine : 46316 Message : Ageingacrossyear StackTrace : at System.Data.Common.DataAdapter.Fill(DataTable[] dataTables, IDataReader dataReader, Int32 startRecord, Int32 maxRecords) at Oracle.ManagedDataAccess.Client.OracleDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable) at clientlevel.Thinclientlevel.Clientlogin.Ageingacrossyear(DateTime tdTransactiondate, Int32 tnTotaldays1, Int32 tnTotaldays2, Int32 tnTotaldays3, Int32 tnAngleselection, Int32 tnTotaldays4, Int32 tnTotaldays5, Int32 tnTotaldays6, Cliole loLdcommon, Int32 tnTotaldays7, Int32 tnTotaldays8, Int32 tnTotaldays9, Int32 tnTotaldays10, Int32 tnTotaldays11, Int32 tnTotaldays12, Int32 tnIncludepreviousyear, Int32 tnIgnorebounced, Int32 tnonlyReconciledentries, Int32 tnTerminalcodejoin, String& tcCashpayindate, String& tcFopayindate, Int32 tnAgeingonTransactiondate, String tcClientcode, Double tnAmount, String& tcSebiageingdate) in File25:line 46316 Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 237400064 Shut down : N Username : MOBBO Date/Time : 17/05/2024 8:12:44 PM Connection : Closed =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Select tblFirmcreation.cshortname as cShortname From tblFirmcreation tblFirmcreation Where tblFirmcreation.cUserFirmcode='NBS-000001' Title : 01~Error Description : Value cannot be null. Parameter name: dataTable Method : AgeingacrossyearLine : 46316 Message : Ageingacrossyear StackTrace : at System.Data.Common.DataAdapter.Fill(DataTable[] dataTables, IDataReader dataReader, Int32 startRecord, Int32 maxRecords) at Oracle.ManagedDataAccess.Client.OracleDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable) at clientlevel.Thinclientlevel.Clientlogin.Ageingacrossyear(DateTime tdTransactiondate, Int32 tnTotaldays1, Int32 tnTotaldays2, Int32 tnTotaldays3, Int32 tnAngleselection, Int32 tnTotaldays4, Int32 tnTotaldays5, Int32 tnTotaldays6, Cliole loLdcommon, Int32 tnTotaldays7, Int32 tnTotaldays8, Int32 tnTotaldays9, Int32 tnTotaldays10, Int32 tnTotaldays11, Int32 tnTotaldays12, Int32 tnIncludepreviousyear, Int32 tnIgnorebounced, Int32 tnonlyReconciledentries, Int32 tnTerminalcodejoin, String& tcCashpayindate, String& tcFopayindate, Int32 tnAgeingonTransactiondate, String tcClientcode, Double tnAmount, String& tcSebiageingdate) in File25:line 46316 Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 654483456 Shut down : N Username : MOBBO Date/Time : 17/05/2024 8:18:10 PM Connection : Closed =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : T5580011 With tbltempReport as (Select '01' as cRowindicator, 'Opening Market Value' as cRowdesc From Dual Union All Select '02' as cRowindicator, 'Capital In(+)/Out(-)' as cRowdesc From Dual Union All Select '03' as cRowindicator, Rpad(' ',8)||'Realized Profit (+)/(-)' as cRowdesc From dual Union All Select '04' as cRowindicator, 'Cash Segment' as cRowdesc From dual Union All Select '05' as cRowindicator, 'Derivatives Segment' as cRowdesc From dual Union All Select '06' as cRowindicator, 'Total Realized Profit(+)/(-) ' as cRowdesc From dual Union All Select '07' as cRowindicator, Rpad(' ',8)||'Un-Realized Profit (+)/(-) ' as cRowdesc From dual Union All Select '08' as cRowindicator, 'Cash Segment' as cRowdesc From dual Union All Select '09' as cRowindicator, 'Derivatives Segment' as cRowdesc From dual Union All Select '10' as cRowindicator, 'Total Un-Realized Profit(+)/(-) ' as cRowdesc From dual Union All Select '11' as cRowindicator, 'Total Dividend Amount' as cRowdesc From dual Union All Select '12' as cRowindicator, Rpad(' ',8)||'Statutory Charges' as cRowdesc From dual Union All Select '13' as cRowindicator, 'Cash Segment' as cRowdesc From dual Union All Select '14' as cRowindicator, 'Derivatives Segment' as cRowdesc From dual Union All Select '15' as cRowindicator, 'Misc. JV Entries' as cRowdesc From dual Union All Select '16' as cRowindicator, 'Direct Dividend Credit' as cRowdesc From dual Union All Select '17' as cRowindicator, 'Total Portfolio Allocation' as cRowdesc From dual Union All Select '18' as cRowindicator, 'Total No. of Days' as cRowdesc From dual Union All Select '19' as cRowindicator, 'Absolute Return' as cRowdesc From dual Union All Select '20' as cRowindicator, 'Annualized Return' as cRowdesc From dual Union All Select '24' as cRowindicator, Rpad(' ',8)||'Portfolio Allocation' as cRowdesc From dual Union All Select '25' as cRowindicator, 'Equity' as cRowdesc From dual Union All Select '26' as cRowindicator, 'Cash and Equivalent' as cRowdesc From dual Union All Select '27' as cRowindicator, 'Total Portfolio Allocation' as cRowdesc From dual ), tblReportdesc as (Select Ldfibs.Oowncode as cClientcode, tbltempReport.* From Ldfibs Ldfibs Left Outer Join tbltempReport On 1=1 Where Ldfibs.Firmnumber='NBS-000001' and (Ldfibs.Oowncode='T5580011') and Ldfibs.Brcode='T558' ), tblOpendet as (Select Ledger.Oowncode as cClientcode, '01' as cRowindicator, Sum(Ledger.Damount-Ledger.Camount)*-1 as nSecamount From Ledger Ledger Where Ledger.Firmnumber='NBS-000001' and Ledger.nFinancialyear=2024 and (Ledger.Oowncode='T5580011') and Ledger.Branchcode='T558' and Substr(Ledger.Voucher,1,4)='OPNG' group by Ledger.Oowncode Union All Select Sauda.Oowncode as cClientcode, '01' as cRowindicator, Sum(Sauda.Quantity*Sauda.Market) as nSecamount From Sauda Sauda Where Sauda.Egroup='OK' and Sauda.Firmnumber = 'NBS-000001' and (Sauda.Oowncode='T5580011') and Sauda.Brcode='T558' group by Sauda.Oowncode ), tblOpenstk as (Select tblOpendet.cClientcode as cClientcode, Max(tblOpendet.cRowindicator) as cRowindicator, 0 as nFiramount, Sum(tblOpendet.nSecamount) as nSecamount From tblOpendet tblOpendet group by tblOpendet.cClientcode), tblCapinout as (Select Ledger.Oowncode as cClientcode, '02' as cRowindicator, 0 as nFiramount, Sum(Ledger.Damount-Ledger.Camount)*-1 as nSecamount From Ledger Ledger Where Ledger.Firmnumber='NBS-000001' and Ledger.nFinancialyear=2024 and (Ledger.Oowncode='T5580011') and Ledger.Branchcode='T558' and Ledger.Dtoftran>=to_date('01/04/2023','dd/mm/yyyy') and Ledger.Dtoftran<=to_date('31/03/2024','dd/mm/yyyy') and (Substr(Ledger.Voucher,1,2)='RE' or Substr(Ledger.Voucher,1,2)='PY') group by Ledger.Oowncode ), tblFinledger as (Select Ledger.Oowncode as cClientcode, '26' as cRowindicator, Sum(Ledger.Damount-Ledger.Camount)*-1 as nFiramount, 0 as nSecamount From Ledger Ledger Where Ledger.Firmnumber='NBS-000001' and Ledger.nFinancialyear=2024 and (Ledger.Oowncode='T5580011') and Ledger.Branchcode='T558' and Ledger.Dtoftran>=to_date('01/04/2023','dd/mm/yyyy') and Ledger.Dtoftran<=to_date('31/03/2024','dd/mm/yyyy') group by Ledger.Oowncode ), tblCashinternal as (Select Sauda.Oowncode as cClientcode, Sauda.Compcode as cScripcode, Sauda.Dtoftran as dBuydate, Sauda.BuySell as cBuysell, Sum(Sauda.Quantity) as nBuyquantity, Case When Sum(Sauda.Brokpercontract) = 0 Then Avg(Sauda.Final_Rat1) Else Case When Sauda.BuySell = 'B' Then Round(((Sum(Sauda.Quantity) * Avg(Sauda.Final_Rat1)) + Sum(Sauda.Brokpercontract)) / Sum(Sauda.Quantity), 10) Else Round(((Sum(Sauda.Quantity) * Avg(Sauda.Final_Rat1)) - Sum(Sauda.Brokpercontract)) / Sum(Sauda.Quantity), 10) End End as nBuynetrate, Sum(Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, Sauda.Quantity * -1))) Over(Partition By Sauda.Oowncode, Sauda.Compcode Order By Sauda.Dtoftran, Sauda.Final_Rat1 rows between current row and unbounded following) as nRunningqty, Sum(Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, 0))) Over(Partition By Sauda.Oowncode, Sauda.Compcode Order By Sauda.Dtoftran, Sauda.Final_Rat1 rows between current row and unbounded following) as nRunningbuytotal, Sum(Sum(Decode(Sauda.Buysell, 'S', Sauda.Quantity, 0))) Over(Partition By Sauda.Oowncode, Sauda.Compcode Order By Sauda.Dtoftran, Sauda.Final_Rat1 rows between current row and unbounded following) as nRunningselltotal, Sum(Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, 0))) Over(Partition By Sauda.Oowncode, Sauda.Compcode) as nSummarybuy, Sum(Sum(Decode(Sauda.Buysell, 'S', Sauda.Quantity, 0))) Over(Partition By Sauda.Oowncode, Sauda.Compcode) as nSummarysell, Sum(Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, 0)) * Case When Sum(Sauda.Brokpercontract) = 0 Then Avg(Sauda.Final_Rat1) Else Case When Sauda.BuySell = 'B' Then Round(((Sum(Sauda.Quantity) * Avg(Sauda.Final_Rat1)) + Sum(Sauda.Brokpercontract)) / Sum(Sauda.Quantity), 10) Else 0 End End) Over(Partition By Sauda.Oowncode, Sauda.Compcode) as nSumBuyamount, Sum(Sum(Decode(Sauda.Buysell, 'S', Sauda.Quantity, 0)) * Case When Sum(Sauda.Brokpercontract) = 0 Then Avg(Sauda.Final_Rat1) Else Case When Sauda.BuySell = 'B' Then 0 Else Round(((Sum(Sauda.Quantity) * Avg(Sauda.Final_Rat1)) - Sum(Sauda.Brokpercontract)) / Sum(Sauda.Quantity), 10) End End) Over(Partition By Sauda.Oowncode, Sauda.Compcode) as nSumSellamount, Sum(Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, Sauda.Quantity * -1))) Over(Partition By Sauda.Oowncode, Sauda.Compcode) As nNetquantity From Sauda Sauda Where Sauda.Firmnumber='NBS-000001' and Sauda.Egroup!='YC' and Sauda.Egroup != 'LB' and Sauda.Egroup != 'SR' and Sauda.Egroup != 'LA' and Sauda.Sterminal != '99999' and Sauda.Dtoftran 0 Then Case When tblCashinternal.nRunningbuytotal > tblCashinternal.nNetquantity Then tblCashinternal.nNetquantity + tblCashinternal.nBuyquantity - tblCashinternal.nRunningbuytotal Else tblCashinternal.nBuyquantity End When tblCashinternal.nNetquantity < 0 Then Case When Abs(tblCashinternal.nRunningselltotal) > Abs(tblCashinternal.nNetquantity) Then tblCashinternal.nNetquantity - tblCashinternal.nBuyquantity + tblCashinternal.nRunningselltotal Else tblCashinternal.nBuyquantity * -1 End End) as nOpStockquantity, Sum((Case When tblCashinternal.nNetquantity = 0 Then 0 When tblCashinternal.nNetquantity > 0 Then Case When tblCashinternal.nRunningbuytotal > tblCashinternal.nNetquantity Then tblCashinternal.nNetquantity + tblCashinternal.nBuyquantity - tblCashinternal.nRunningbuytotal Else tblCashinternal.nBuyquantity End When tblCashinternal.nNetquantity < 0 Then Case When Abs(tblCashinternal.nRunningselltotal) > Abs(tblCashinternal.nNetquantity) Then tblCashinternal.nNetquantity - tblCashinternal.nBuyquantity + tblCashinternal.nRunningselltotal Else tblCashinternal.nBuyquantity * -1 End End) * tblCashinternal.nBuynetrate) as nOpStockAmount from tblCashinternal Where (tblCashinternal.nNetquantity > 0 And tblCashinternal.cBuysell = 'B' And tblCashinternal.nRunningbuytotal <= tblCashinternal.nNetquantity + tblCashinternal.nBuyquantity) or (tblCashinternal.nNetquantity < 0 and tblCashinternal.cBuysell = 'S' and Abs(tblCashinternal.nRunningselltotal) <= Abs(tblCashinternal.nNetquantity) + tblCashinternal.nBuyquantity) Group By tblCashinternal.cClientcode, tblCashinternal.cScripcode), tblCashinternal1 as (Select Sauda.Oowncode as cClientcode, Sauda.Compcode as cScripcode, Sauda.Dtoftran as dBuydate, Sauda.BuySell as cBuysell, Sum(Sauda.Quantity) as nBuyquantity, Case When Sum(Sauda.Brokpercontract) = 0 Then Avg(Sauda.Final_Rat1) Else Case When Sauda.BuySell = 'B' Then Round(((Sum(Sauda.Quantity) * Avg(Sauda.Final_Rat1)) + Sum(Sauda.Brokpercontract)) / Sum(Sauda.Quantity), 10) Else Round(((Sum(Sauda.Quantity) * Avg(Sauda.Final_Rat1)) - Sum(Sauda.Brokpercontract)) / Sum(Sauda.Quantity), 10) End End as nBuynetrate, Sum(Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, Sauda.Quantity * -1))) Over(Partition By Sauda.Oowncode, Sauda.Compcode Order By Sauda.Dtoftran, Sauda.Final_Rat1 rows between current row and unbounded following) as nRunningqty, Sum(Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, 0))) Over(Partition By Sauda.Oowncode, Sauda.Compcode Order By Sauda.Dtoftran, Sauda.Final_Rat1 rows between current row and unbounded following) as nRunningbuytotal, Sum(Sum(Decode(Sauda.Buysell, 'S', Sauda.Quantity, 0))) Over(Partition By Sauda.Oowncode, Sauda.Compcode Order By Sauda.Dtoftran, Sauda.Final_Rat1 rows between current row and unbounded following) as nRunningselltotal, Sum(Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, 0))) Over(Partition By Sauda.Oowncode, Sauda.Compcode) as nSummarybuy, Sum(Sum(Decode(Sauda.Buysell, 'S', Sauda.Quantity, 0))) Over(Partition By Sauda.Oowncode, Sauda.Compcode) as nSummarysell, Sum(Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, 0)) * Case When Sum(Sauda.Brokpercontract) = 0 Then Avg(Sauda.Final_Rat1) Else Case When Sauda.BuySell = 'B' Then Round(((Sum(Sauda.Quantity) * Avg(Sauda.Final_Rat1)) + Sum(Sauda.Brokpercontract)) / Sum(Sauda.Quantity), 10) Else 0 End End) Over(Partition By Sauda.Oowncode, Sauda.Compcode) as nSumBuyamount, Sum(Sum(Decode(Sauda.Buysell, 'S', Sauda.Quantity, 0)) * Case When Sum(Sauda.Brokpercontract) = 0 Then Avg(Sauda.Final_Rat1) Else Case When Sauda.BuySell = 'B' Then 0 Else Round(((Sum(Sauda.Quantity) * Avg(Sauda.Final_Rat1)) - Sum(Sauda.Brokpercontract)) / Sum(Sauda.Quantity), 10) End End) Over(Partition By Sauda.Oowncode, Sauda.Compcode) as nSumSellamount, Sum(Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, Sauda.Quantity * -1))) Over(Partition By Sauda.Oowncode, Sauda.Compcode) As nNetquantity From Sauda Sauda Where Sauda.Firmnumber='NBS-000001' and Sauda.Egroup!='YC' and Sauda.Egroup != 'LB' and Sauda.Egroup != 'SR' and Sauda.Egroup != 'LA' and Sauda.Sterminal != '99999' and Sauda.Dtoftran<=to_date('31/03/2024','dd/mm/yyyy') and Sauda.Brcode='T558' and (Sauda.Oowncode='T5580011') group by Sauda.Oowncode, Sauda.Dtoftran, Sauda.Final_Rat1, Sauda.buysell, Sauda.Compcode), tblClosing as (Select tblCashinternal1.cClientcode as cClientcode, tblCashinternal1.cScripcode as cScripcode, Sum(Case When tblCashinternal1.nNetquantity = 0 Then 0 When tblCashinternal1.nNetquantity > 0 Then Case When tblCashinternal1.nRunningbuytotal > tblCashinternal1.nNetquantity Then tblCashinternal1.nNetquantity + tblCashinternal1.nBuyquantity - tblCashinternal1.nRunningbuytotal Else tblCashinternal1.nBuyquantity End When tblCashinternal1.nNetquantity < 0 Then Case When Abs(tblCashinternal1.nRunningselltotal) > Abs(tblCashinternal1.nNetquantity) Then tblCashinternal1.nNetquantity - tblCashinternal1.nBuyquantity + tblCashinternal1.nRunningselltotal Else tblCashinternal1.nBuyquantity * -1 End End) AS nCLStockquantity, Sum((Case When tblCashinternal1.nNetquantity = 0 Then 0 When tblCashinternal1.nNetquantity > 0 Then Case When tblCashinternal1.nRunningbuytotal > tblCashinternal1.nNetquantity Then tblCashinternal1.nNetquantity + tblCashinternal1.nBuyquantity - tblCashinternal1.nRunningbuytotal Else tblCashinternal1.nBuyquantity End When tblCashinternal1.nNetquantity < 0 Then Case When Abs(tblCashinternal1.nRunningselltotal) > Abs(tblCashinternal1.nNetquantity) Then tblCashinternal1.nNetquantity - tblCashinternal1.nBuyquantity + tblCashinternal1.nRunningselltotal Else tblCashinternal1.nBuyquantity * -1 End End) * tblCashinternal1.nBuynetrate) as nClStockAmount from tblCashinternal1 Where (tblCashinternal1.nNetquantity > 0 And tblCashinternal1.cBuysell = 'B' And tblCashinternal1.nRunningbuytotal <= tblCashinternal1.nNetquantity + tblCashinternal1.nBuyquantity) or (tblCashinternal1.nNetquantity < 0 and tblCashinternal1.cBuysell = 'S' and Abs(tblCashinternal1.nRunningselltotal) <= Abs(tblCashinternal1.nNetquantity) + tblCashinternal1.nBuyquantity) Group By tblCashinternal1.cClientcode, tblCashinternal1.cScripcode), tblBuYSell as (Select Sauda.Oowncode as cClientcode, Sauda.Compcode as cScripcode, Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, 0)) as nbuyQty, Sum(Decode(Sauda.Buysell, 'S', Sauda.Quantity, 0)) as nsellQty, Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity * Sauda.Final_Rat1 , 0)+Case When Sauda.Buysell='B' then Sauda.Brokpercontract else 0 end) as nBuyamount, Sum(Decode(Sauda.Buysell, 'S', Sauda.Quantity * Sauda.Final_Rat1 , 0)-Case When Sauda.Buysell='S' then Sauda.Brokpercontract else 0 end) as nSellamount From Sauda Sauda Where Sauda.Firmnumber='NBS-000001' and Sauda.Egroup!='YC' and Sauda.Egroup != 'LB' and Sauda.Egroup != 'SR' and Sauda.Egroup != 'LA' and Sauda.Sterminal != '99999' and Sauda.Dtoftran>=to_date('01/04/2023','dd/mm/yyyy') and Sauda.Dtoftran<=to_Date('31/03/2024','dd/mm/yyyy') and Sauda.Brcode='T558' and (Sauda.Oowncode='T5580011') group by Sauda.Oowncode, Sauda.Compcode), tblCashcost as (Select Coalesce(tblOpening.cClientcode,tblClosing.cClientcode,tblBuysell.cClientcode) as cClientcode, Coalesce(tblOpening.cScripcode,tblClosing.cScripcode,tblBuysell.cScripcode) as cScripcode, Nvl(tblOpening.nOpstockquantity,0) as nOpstockquantity, Nvl(tblOpening.nOpstockamount,0) as nOpstockamount, Case When Nvl(tblOpening.nOpstockquantity,0)!=0 then Round(Nvl(tblOpening.nOpstockamount,0)/Nvl(tblOpening.nOpstockquantity,0),4) else 0 end as nOpstockavg, Nvl(tblBuysell.nBuyqty,0) as nPrePurchqty, Nvl(tblBuysell.nBuyamount,0) as nPrePurchvalue, Case When Nvl(tblBuysell.nBuyqty,0) !=0 then Round(Nvl(tblBuysell.nBuyamount,0)/Nvl(tblBuysell.nBuyqty,0),4) else 0 end as nPrePurchavg, Nvl(tblBuysell.nSellQty, 0) as nPreSellqty, Nvl(tblBuysell.nSellamount, 0) as nPreSellvalue, Case When Nvl(tblBuysell.nSellQty, 0) != 0 then Round(Nvl(tblBuysell.nSellamount, 0) / Nvl(tblBuysell.nSellQty, 0), 4) else 0 end as nPreSellavg, Least((Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockquantity, 0) + Nvl(tblBuysell.nBuyqty, 0) Else Nvl(tblBuysell.nBuyqty, 0) End), (Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockquantity, 0)) + Nvl(tblBuysell.nSellqty, 0) Else Nvl(tblBuysell.nSellqty, 0) End)) as nPurchqty, Round((Case When (Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockquantity, 0) + Nvl(tblBuysell.nBuyqty, 0) Else Nvl(tblBuysell.nBuyqty, 0) End) <= (Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockquantity, 0)) + Nvl(tblBuysell.nSellqty, 0) Else Nvl(tblBuysell.nSellqty, 0) End) Then Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockAmount, 0) + Nvl(tblBuysell.nBuyAmount, 0) Else Nvl(tblBuysell.nBuyAmount, 0) End Else Nvl(tblBuysell.nBuyAmount, 0) + Nvl(tblOpening.nOpstockAmount, 0) - nvl(tblClosing.nClStockAmount, 0) End), 2) as nPurchvalue, Round((Case When Least((Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockquantity, 0) + Nvl(tblBuysell.nBuyqty, 0) Else Nvl(tblBuysell.nBuyqty, 0) End), (Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockquantity, 0)) + Nvl(tblBuysell.nSellqty, 0) Else Nvl(tblBuysell.nSellqty, 0) End)) != 0 Then (Case When (Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockquantity, 0) + Nvl(tblBuysell.nBuyqty, 0) Else Nvl(tblBuysell.nBuyqty, 0) End) <= (Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockquantity, 0)) + Nvl(tblBuysell.nSellqty, 0) Else Nvl(tblBuysell.nSellqty, 0) End) Then Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockAmount, 0) + Nvl(tblBuysell.nBuyAmount, 0) Else Nvl(tblBuysell.nBuyAmount, 0) End Else Nvl(tblBuysell.nBuyAmount, 0) + Nvl(tblOpening.nOpstockAmount, 0) - nvl(tblClosing.nClStockAmount, 0) End) / (Least((Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockquantity, 0) + Nvl(tblBuysell.nBuyqty, 0) Else Nvl(tblBuysell.nBuyqty, 0) End), (Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockquantity, 0)) + Nvl(tblBuysell.nSellqty, 0) Else Nvl(tblBuysell.nSellqty, 0) End))) Else 0 End), 4) as nPurchavg, Least((Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockquantity, 0) + Nvl(tblBuysell.nBuyqty, 0) Else Nvl(tblBuysell.nBuyqty, 0) End), (Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockquantity, 0)) + Nvl(tblBuysell.nSellqty, 0) Else Nvl(tblBuysell.nSellqty, 0) End)) as nSalesqty, Round((Case When (Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockquantity, 0) + Nvl(tblBuysell.nBuyqty, 0) Else Nvl(tblBuysell.nBuyqty, 0) End) >= (Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockquantity, 0)) + Nvl(tblBuysell.nSellqty, 0) Else Nvl(tblBuysell.nSellqty, 0) End) Then Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockAmount, 0)) + Nvl(tblBuysell.nSellAmount, 0) Else Nvl(tblBuysell.nSellAmount, 0) End Else Nvl(tblBuysell.nSellAmount, 0) - Nvl(tblOpening.nOpstockAmount, 0) + nvl(tblClosing.nClStockAmount, 0) End), 2) as nSalesvalue, Round((Case When Least((Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockquantity, 0) + Nvl(tblBuysell.nBuyqty, 0) Else Nvl(tblBuysell.nBuyqty, 0) End), (Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockquantity, 0)) + Nvl(tblBuysell.nSellqty, 0) Else Nvl(tblBuysell.nSellqty, 0) End)) != 0 Then (Case When (Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockquantity, 0) + Nvl(tblBuysell.nBuyqty, 0) Else Nvl(tblBuysell.nBuyqty, 0) End) >= (Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockquantity, 0)) + Nvl(tblBuysell.nSellqty, 0) Else Nvl(tblBuysell.nSellqty, 0) End) Then Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockAmount, 0)) + Nvl(tblBuysell.nSellAmount, 0) Else Nvl(tblBuysell.nSellAmount, 0) End Else Nvl(tblBuysell.nSellAmount, 0) - Nvl(tblOpening.nOpstockAmount, 0) + nvl(tblClosing.nClStockAmount, 0) End) / (Least((Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockquantity, 0) + Nvl(tblBuysell.nBuyqty, 0) Else Nvl(tblBuysell.nBuyqty, 0) End), (Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockquantity, 0)) + Nvl(tblBuysell.nSellqty, 0) Else Nvl(tblBuysell.nSellqty, 0) End))) ELse 0 End), 4) as nSalesavg, Nvl(tblClosing.nClstockquantity, 0) as nOsstock, Nvl(tblClosing.nClstockamount, 0) as nOsstockvalue, Case When Nvl(tblClosing.nClstockquantity, 0) != 0 then Round(Nvl(tblClosing.nClstockamount, 0) / Nvl(tblClosing.nClstockquantity, 0), 4) else 0 end as nOsstockavg, (nvl(tblBuySell.nSellAmount, 0) - nvl(tblOpening.nOpStockAmount, 0) - nvl(tblBuySell.nBuyAmount, 0) + nvl(tblClosing.nClStockAmount, 0)) as nProfitloss, ((Market.Market * nvl(tblClosing.nClstockquantity, 0)) - Nvl(tblClosing.nClstockamount, 0)) As nUnrealprlo, (nvl(tblBuySell.nSellAmount, 0) - nvl(tblOpening.nOpStockAmount, 0) - nvl(tblBuySell.nBuyAmount, 0) + nvl(tblClosing.nClStockAmount, 0)) + ((Market.Market * nvl(tblClosing.nClstockquantity, 0)) - Nvl(tblClosing.nClstockamount, 0)) As nOverallprlo, Market.Market as nMarketrate, Market.Market*Nvl(tblClosing.nClstockquantity,0) As nMarketvalue from tblOPening tblOpening Full Join TblClosing on tblOpening.cclientcode = tblclosing.cclientcode and tblOPening.cScripcode = tblClosing.cScripcode Full Join TblBuySell on tblBuySell.cclientcode = coalesce(tblOpening.cclientcode, tblclosing.cclientcode) and tblBuySell.cScripcode = coalesce(tblOPening.cScripcode, tblClosing.cScripcode) Left Outer Join Market Market On Market.Firmnumber='NBS-000001' and Market.code=coalesce(tblOpening.cScripcode, tblclosing.cScripcode, tblBuysell.cScripcode) ), tblOpendet as (Select Ledger.Oowncode as cClientcode, '01' as cRowindicator, Sum(Ledger.Damount-Ledger.Camount)*-1 as nSecamount From Ledger Ledger Where Ledger.Firmnumber='NBS-000001' and Ledger.nFinancialyear = 2024 and (Ledger.Oowncode='T5580011') and Ledger.Branchcode='T558' and Substr(Ledger.Voucher,1,4)='OPNG' group by Ledger.Oowncode Union All Select tblCashcost.cClientcode as cClientcode, '01' as cRowindicator, Sum(tblCashcost.nOpstockamount) as nSecamount From tblCashcost tblCashcost group by tblCashcost.cClientcode ), tblOpenstk as (Select tblOpendet.cClientcode as cClientcode, Max(tblOpendet.cRowindicator) as cRowindicator, 0 as nFiramount, Sum(tblOpendet.nSecamount) as nSecamount From tblOpendet tblOpendet group by tblOpendet.cClientcode), tblPortcashfin as (Select tblCashcost.cClientcode as cClientcode, '04' as cRowindicator, Sum(tblCashcost.nProfitloss) as nFiramount, 0 as nSecamount From tblCashcost tblCashcost group by tblCashcost.cClientcode Union All Select tblCashcost.cClientcode as cClientcode, '25' as cRowindicator, Sum(tblCashcost.nMarketvalue) as nFiramount, 0 as nSecamount From tblCashcost tblCashcost group by tblCashcost.cClientcode Union All Select tblCashcost.cClientcode as cClientcode, '08' as cRowindicator, Sum(tblCashcost.nUnrealprlo) as nFiramount, 0 as nSecamount From tblCashcost tblCashcost group by tblCashcost.cClientcode ), tblFointernal as (Select Fosauda.Oowncode as cClientcode, Fosauda.Compcode as cScripcode, Fosauda.Strikeprice as nStrikeprice, Fosauda.Optiontype as cOptiontype, Company.Fibsacct as cScripname, Company.Expirydate as dExpirydate, Exchange.Operation as cOperation, Company.Instrutyp as cInstrutyp, Company.nBaseunit as nBaseunit, Company.cUnitofmeasurement as cUnitofmeasurement, Company.cUnitofTrading as cUnitofTrading, Company.nTradeablelot as nTradeablelot, Company.nPricenumerator as nPricenumerator, Company.nPricedenominator as nPricedenominator, Company.nGeneralnumerator as nGeneralnumerator, Company.nGeneraldenominator as nGeneraldenominator, Fosauda.Dtoftran as dBuydate, Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') or Fosauda.Optiontype != 'PO' Then Fosauda.Buysell else Case When Fosauda.Buysell = 'B' Then 'S' Else 'B' End end as cBuysell, Sum(Fosauda.quantity) as nBuyquantity, Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') Then Case When Sum(Fosauda.nValuebrokerage) = 0 then Avg(Fosauda.Final_Rat1) else Case When Fosauda.BuySell = 'B' Then Round(((Sum(Fosauda.Quantity) * Avg(Fosauda.Final_Rat1)) + Sum(Fosauda.nValuebrokerage)) / Sum(Fosauda.Quantity), 10) Else Round(((Sum(Fosauda.Quantity) * Avg(Fosauda.Final_Rat1)) - Sum(Fosauda.nValuebrokerage)) / Sum(Fosauda.Quantity), 10) End End Else Case When Fosauda.Buysell = 'B' Then Avg(Fosauda.Final_rat1) - Avg(Fosauda.Strikeprice) else Avg(Fosauda.Strikeprice) - Avg(Fosauda.Final_rat1) End End as nBuynetrate, Sum(Sum(Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') or Fosauda.Optiontype != 'PO' Then Decode(Fosauda.Buysell, 'B', Fosauda.Quantity, Fosauda.Quantity * -1) Else Decode(Fosauda.Buysell, 'S', Fosauda.Quantity, Fosauda.Quantity * -1) End)) Over(Partition By Fosauda.Oowncode, Company.Fibsacct, Fosauda.Strikeprice, Fosauda.Optiontype Order By Fosauda.Dtoftran, Fosauda.Final_Rat1 rows between current row and unbounded following) as nRunningqty, Sum(Sum(Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') or Fosauda.optiontype != 'PO' Then Decode(Fosauda.Buysell, 'B', Fosauda.Quantity, 0) Else Decode(Fosauda.Buysell, 'S', Fosauda.Quantity, 0) End)) Over(Partition By Fosauda.Oowncode, Company.Fibsacct, Fosauda.Strikeprice, Fosauda.Optiontype Order By Fosauda.Dtoftran, Fosauda.Final_Rat1 rows between current row and unbounded following) as nRunningbuytotal, Sum(Sum(Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') or Fosauda.Optiontype != 'PO' Then Decode(Fosauda.Buysell, 'S', Fosauda.Quantity, 0) Else Decode(Fosauda.Buysell, 'B', Fosauda.Quantity, 0) End)) Over(Partition By Fosauda.Oowncode, Company.Fibsacct, Fosauda.Strikeprice, Fosauda.Optiontype Order By Fosauda.Dtoftran, Fosauda.Final_Rat1 rows between current row and unbounded following) as nRunningselltotal, Sum(Sum(Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') or Fosauda.optiontype != 'PO' Then Decode(Fosauda.Buysell, 'B', Fosauda.Quantity, 0) Else Decode(Fosauda.Buysell, 'S', Fosauda.Quantity, 0) End)) Over(Partition By Fosauda.Oowncode, Company.Fibsacct, Fosauda.Strikeprice, Fosauda.Optiontype) as nSummarybuy, Sum(Sum(Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') or Fosauda.optiontype != 'PO' Then Decode(Fosauda.Buysell, 'S', Fosauda.Quantity, 0) Else Decode(Fosauda.Buysell, 'B', Fosauda.Quantity, 0) End)) Over(Partition By Fosauda.Oowncode, Company.Fibsacct, Fosauda.Strikeprice, Fosauda.Optiontype) as nSummarysell, Sum(Sum(Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') or Fosauda.Optiontype != 'PO' Then Decode(Fosauda.Buysell, 'B', Fosauda.Quantity, 0) Else Decode(Fosauda.Buysell, 'S', Fosauda.Quantity, 0) End) * Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') Then Case When Sum(Fosauda.nValuebrokerage) = 0 then Avg(Fosauda.Final_Rat1) else Case When Fosauda.BuySell = 'B' Then Round(((Sum(Fosauda.Quantity) * Avg(Fosauda.Final_Rat1)) + Sum(Fosauda.nValuebrokerage)) / Sum(Fosauda.Quantity), 10) Else Round(((Sum(Fosauda.Quantity) * Avg(Fosauda.Final_Rat1)) - Sum(Fosauda.nValuebrokerage)) / Sum(Fosauda.Quantity), 10) End End Else Abs(Avg(Fosauda.Final_Rat1) - Avg(fosauda.strikeprice)) End) Over(Partition By Fosauda.Oowncode, Company.Fibsacct, Fosauda.Strikeprice, Fosauda.Optiontype) as nSumBuyamount, Sum(Sum(Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') or Fosauda.Optiontype != 'PO' Then Decode(Fosauda.Buysell, 'S', Fosauda.Quantity, 0) Else Decode(Fosauda.Buysell, 'B', Fosauda.Quantity, 0) End) * Case When (Fosauda.saudatype != 'AS' and Fosauda.Saudatype != 'EX') Then Case When Sum(Fosauda.nValuebrokerage) = 0 then Avg(Fosauda.Final_Rat1) else Case When Fosauda.BuySell = 'B' Then Round(((Sum(Fosauda.Quantity) * Avg(Fosauda.Final_Rat1)) + Sum(Fosauda.nValuebrokerage)) / Sum(Fosauda.Quantity), 10) Else Round(((Sum(Fosauda.Quantity) * Avg(Fosauda.Final_Rat1)) - Sum(Fosauda.nValuebrokerage)) / Sum(Fosauda.Quantity), 10) End End Else Abs(Avg(Fosauda.Final_Rat1) - Avg(fosauda.strikeprice)) End) Over(Partition By Fosauda.Oowncode, Company.Fibsacct, Fosauda.Strikeprice, Fosauda.Optiontype) as nSumSellamount, Sum(Sum(Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') or Fosauda.optiontype != 'PO' Then Decode(Fosauda.Buysell, 'B', Fosauda.Quantity, Fosauda.Quantity * -1) Else Decode(Fosauda.Buysell, 'S', Fosauda.Quantity, Fosauda.Quantity * -1) End)) Over(Partition By Fosauda.Oowncode, Company.Fibsacct, Fosauda.Strikeprice, Fosauda.Optiontype) As nNetquantity From Fosauda Fosauda Inner Join Company Company On Fosauda.firmnumber = Company.Firmnumber and Fosauda.Compcode = Company.oowncode Inner Join Exchange Exchange On Fosauda.Firmnumber = Exchange.Firmnumber and Fosauda.Exchcode = Exchange.Code Where Fosauda.Firmnumber = 'NBS-000001' and Fosauda.Egroup != 'YF' and Fosauda.Egroup != 'LB' and Fosauda.Egroup != 'SR' and Fosauda.Egroup != 'LA' and Fosauda.Sterminal != '99999' and (Fosauda.Oowncode='T5580011') and Fosauda.Brcode='T558' and Fosauda.Dtoftran>=to_date('01/04/2023','dd/mm/yyyy') and Fosauda.Dtoftran<=to_date('31/03/2024','dd/mm/yyyy') and ((Fosauda.Saudatype != 'B/' and Fosauda.Orignalno = 0) or (Fosauda.Saudatype = 'B/' and (Fosauda.Orignalno = -99 or Fosauda.Dtoftran=to_date('01/04/2023','dd/mm/yyyy')))) group by Fosauda.Oowncode, Company.Fibsacct, Company.Expirydate, Exchange.Operation, Company.Instrutyp, Company.nBaseunit, Company.cUnitofmeasurement, Company.cUnitofTrading, Company.nTradeablelot, Company.nPricenumerator, Company.nPricedenominator, Company.nGeneralnumerator, Company.nGeneraldenominator, Fosauda.Dtoftran, Fosauda.Final_Rat1, Fosauda.buysell, Fosauda.Compcode, Fosauda.Strikeprice, Fosauda.Saudatype, Fosauda.Optiontype), tblFocost as (Select tblFointernal.cClientcode as cClientcode, tblFointernal.cScripcode as cScripcode, tblFointernal.nStrikeprice as nStrikeprice, tblFointernal.cOptiontype as cOptiontype, tblFointernal.cScripname as cScripname, tblFointernal.cOperation as cOperation, tblFoInternal.cInstrutyp as cInstrutyp, tblFoInternal.nBaseunit as nBaseunit, tblFoInternal.cUnitofmeasurement as cUnitofmeasurement, tblFoInternal.cUnitofTrading as cUnitofTrading, tblFoInternal.nTradeablelot as nTradeablelot, tblFoInternal.nPricenumerator as nPricenumerator, tblFoInternal.nPricedenominator as nPricedenominator, tblFoInternal.nGeneralnumerator as nGeneralnumerator, tblFoInternal.nGeneraldenominator as nGeneraldenominator, tblFointernal.dExpirydate as dExpirydate, tblFointernal.dBuydate as dBuydate, tblFointernal.nBuynetrate as nBuynetrate, Case When tblFointernal.nNetquantity = 0 Then 0 When tblFointernal.nNetquantity > 0 Then Case When tblFointernal.nRunningbuytotal > tblFointernal.nNetquantity Then tblFointernal.nNetquantity + tblFointernal.nBuyquantity - tblFointernal.nRunningbuytotal Else tblFointernal.nBuyquantity End When tblFointernal.nNetquantity < 0 Then Case When abs(tblFointernal.nRunningselltotal) > abs(tblFointernal.nNetquantity) Then tblFointernal.nNetquantity - tblFointernal.nBuyquantity + tblFointernal.nRunningselltotal Else tblFointernal.nBuyquantity * -1 End End AS nStockquantity, tblFointernal.nSummarybuy as nSummarybuy, tblFointernal.nSumBuyamount as nSumbuyamount, tblFointernal.nSummarysell as nSummarysell, tblFointernal.nSumSellamount as nSumsellamount From tblFointernal tblFoInternal Where (tblFointernal.nNetquantity > 0 and tblFointernal.cBuysell = 'B' and tblFointernal.nRunningbuytotal <= tblFointernal.nNetquantity + tblFointernal.nBuyquantity) or (tblFointernal.nNetquantity < 0 and tblFointernal.cBuysell = 'S' and abs(tblFointernal.nRunningselltotal) <= Abs(tblFointernal.nNetquantity) + tblFointernal.nBuyquantity) or (tblFointernal.nNetquantity = 0 And tblFointernal.nRunningselltotal = tblFointernal.nSummarysell and tblFointernal.nRunningbuytotal = tblFointernal.nSummarybuy)), tblFinalcost as (Select tblFocost.cClientcode as cClientcode, tblFocost.cScripcode as cScripcode, tblFocost.nStrikeprice as nStrikeprice, tblFocost.cOptiontype as cOptiontype, tblFocost.dExpirydate as dExpirydate, tblFocost.cScripname as cScripname, tblFocost.cOperation as cOperation, tblFocost.cInstrutyp as cInstrutyp, tblFocost.nBaseunit as nBaseunit, tblFocost.cUnitofmeasurement as cUnitofmeasurement, tblFocost.cUnitofTrading as cUnitofTrading, tblFocost.nTradeablelot as nTradeablelot, tblFocost.nPricenumerator as nPricenumerator, tblFocost.nPricedenominator as nPricedenominator, tblFocost.nGeneralnumerator as nGeneralnumerator, tblFocost.nGeneraldenominator as nGeneraldenominator, tblFocost.nSummarybuy - (Case When Sum(tblFocost.nStockquantity) > 0 then Sum(tblFocost.nStockquantity) else 0 end) As nPurchqty, tblFocost.nSumbuyamount - (Case When Sum(tblFocost.nStockquantity) > 0 then Sum(tblFocost.nStockquantity * tblFocost.nBuyNetRate) else 0 end) As nPurchvalue, tblFocost.nSummarysell - (Case When Sum(tblFocost.nStockquantity) < 0 then Sum(Abs(tblFocost.nStockquantity)) else 0 end) as nSalesqty, tblFocost.nSumSellamount - (Case When Sum(tblFocost.nStockquantity) < 0 then Sum(Abs(tblFocost.nStockquantity) * tblFocost.nBuyNetRate) else 0 end) as nSalesvalue, Sum(tblFocost.nStockquantity) As nOsstock, Case When Sum(tblFocost.nStockquantity) != 0 then Round(Sum(tblFocost.nStockquantity * tblFocost.nBuyNetRate) / Sum(tblFocost.nStockquantity), 4) else 0 end as nOsstockavg, Sum(tblFocost.nStockquantity * tblFocost.nBuyNetRate) as nOsstockvalue, tblFocost.nSumSellamount + Sum(tblFocost.nStockquantity * tblFocost.nBuyNetRate) - tblFocost.nSumBuyamount as nProfitLoss, Max(Market.Market) as nMarketrate, Max(Market.Market) * Sum(tblFocost.nStockquantity) as nMarketvalue, ((tblFocost.nSumSellamount + Sum(tblFocost.nStockquantity * tblFocost.nBuyNetRate) - tblFocost.nSumBuyamount)) + ((Max(Market.Market) * Sum(tblFocost.nStockquantity)) - (Sum(tblFocost.nStockquantity * tblFocost.nBuyNetRate))) as nOverallprlo, Max(Market.nPrvcloseprice) as nPrvcloseprice, Max(Market.nHighprice) as nHighprice, Max(Market.nLowprice) as nLowprice, Max(Market.nLowercircuitLimit) as nLowercircuitlimit, Max(Market.nOpenprice) as nOpenprice, Max(Market.nUppercircuitlimit) as nUppercircuitlimit, Max(Market.nNoofTrades) as nNooftrades, Max(Market.nVoltradedToday) as nVoltradedtoday, Max(Market.nVolquantity) as nVolquantity, Max(Market.dLastupdatedate) as dlastupdatedate, Max(Market.n52Weeklow) as n52Weeklow, Max(Market.n52WeekHigh) as n52Weekhigh From tblFocost tblFocost Left Outer Join Market Market On Market.Firmnumber = 'NBS-000001' and tblFocost.cScripcode = Market.Code and tblFocost.nStrikeprice = Market.Strikeprice and tblFocost.cOptiontype = Market.Optiontype and ((Market.nOptmethod = 0 and tblFocost.nStrikeprice = 0) or (Market.nOptmethod = 1 and tblFocost.nStrikeprice != 0)) Group By tblFocost.cClientcode, tblFocost.cScripcode, tblFocost.cScripname, tblFocost.cOperation, tblFocost.cInstrutyp, tblFocost.nBaseunit, tblFocost.cUnitofmeasurement, tblFocost.cUnitofTrading, tblFocost.nTradeablelot, tblFocost.nPricenumerator, tblFocost.nPricedenominator, tblFocost.nGeneralnumerator, tblFocost.nGeneraldenominator, tblFocost.dExpirydate, tblFocost.nStrikeprice, tblFocost.cOptiontype, tblFocost.nSummarybuy, tblFocost.nSumBuyamount, tblFocost.nSummarysell, tblFocost.nSumSellamount), tblPortderfinal as (Select tblFinalcost.cClientcode as cClientcode, tblFinalcost.cScripcode as cScripcode, tblFinalcost.cScripname as cScripname, tblFinalcost.cOperation as cOperation, tblFinalcost.cInstrutyp as cInstrutyp, tblFinalcost.nBaseunit as nBaseunit, tblFinalcost.cUnitofmeasurement as cUnitofmeasurement, tblFinalcost.cUnitofTrading as cUnitofTrading, tblFinalcost.nTradeablelot as nTradeablelot, tblFinalcost.nPricenumerator as nPricenumerator, tblFinalcost.nPricedenominator as nPricedenominator, tblFinalcost.nGeneralnumerator as nGeneralnumerator, tblFinalcost.nGeneraldenominator as nGeneraldenominator, tblFinalcost.nStrikeprice as nStrikeprice, tblFinalcost.cOptiontype as cOptiontype, tblFinalcost.dExpirydate as dExpirydate, tblFinalcost.nPurchqty As nPurchqty, tblFinalcost.nPurchvalue As nPurchvalue, Round(Case When tblFinalcost.nPurchqty != 0 then tblFinalcost.nPurchvalue / tblFinalcost.nPurchqty else 0 End, 4) As nPurchavg, tblFinalcost.nSalesqty as nSalesqty, tblFinalcost.nSalesvalue as nSalesvalue, Round(Case When tblFinalcost.nSalesqty != 0 then tblFinalcost.nSalesvalue / tblFinalcost.nSalesqty else 0 end, 4) as nSalesavg, tblFinalcost.nOsstock As nOsstock, tblFinalcost.nOsstockavg as nOsstockavg, tblFinalcost.nOsstockvalue as nOsstockvalue, tblFinalcost.nMarketrate as nMarketrate, tblFinalcost.nMarketvalue as nMarketvalue, ((tblFinalcost.nMarketrate * tblFinalcost.nOsstock) - (tblFinalcost.nOsstock * tblFinalcost.nOsstockavg)) as nUnrealprlo, tblFinalcost.nProfitloss as nProfitLoss, tblFinalcost.nOverallprlo as nOverallprlo, tblFinalcost.nPrvcloseprice as nPrvcloseprice, tblFinalcost.nHighprice as nHighprice, tblFinalcost.nLowprice as nLowprice, tblFinalcost.nLowercircuitLimit as nLowercircuitlimit, tblFinalcost.nOpenprice as nOpenprice, tblFinalcost.nUppercircuitlimit as nUppercircuitlimit, tblFinalcost.nNooftrades as nNooftrades, tblFinalcost.nVoltradedtoday as nVoltradedtoday, tblFinalcost.nVolquantity as nVolquantity, tblFinalcost.dLastupdatedate as dlastupdatedate, tblFinalcost.n52WeekLow as n52Weeklow, tblFinalcost.n52Weekhigh as n52Weekhigh From tblFinalcost tblFinalcost Order by tblFinalcost.cClientcode, tblFinalcost.cScripname, tblFinalcost.nStrikeprice, tblFinalcost.cOptiontype, tblFinalcost.dExpirydate ), tblPortderfin as (Select tblPortderfinal.cClientcode as cClientcode, '05' as cRowindicator, Sum(tblPortderfinal.nProfitloss) as nFiramount, 0 as nSecamount From tblPortderfinal tblPortderfinal group by tblPortderfinal.cClientcode Union All Select tblPortderfinal.cClientcode as cClientcode, '09' as cRowindicator, Sum(tblPortderfinal.nUnrealprlo) as nFiramount, 0 as nSecamount From tblPortderfinal tblPortderfinal group by tblPortderfinal.cClientcode), tblCashplusderfinal as (Select Coalesce(tblPortcashfin.cClientcode,tblPortderfin.cClientcode) as cClientcode, Case When Coalesce(tblPortcashfin.cRowindicator,tblPortderfin.cRowindicator)='04' or Coalesce(tblPortcashfin.cRowindicator,tblPortderfin.cRowindicator)='05' then '06' else '10' end as cRowindicator, 0 as nFiramount, Sum(Coalesce(tblPortcashfin.nFiramount,tblPortderfin.nFiramount,0)) as nSecamount From tblPortcashfin Full outer join tblPortderfin On tblPortcashfin.cClientcode=tblPortderfin.cClientcode and tblPortcashfin.cRowindicator=tblPortderfin.cRowindicator Where tblPortcashfin.cRowindicator='04' or tblPortcashfin.cRowindicator='08' or tblPortderfin.cRowindicator='05' or tblPortderfin.cRowindicator='09' group by Coalesce(tblPortcashfin.cClientcode,tblPortderfin.cClientcode) , Case When Coalesce(tblPortcashfin.cRowindicator,tblPortderfin.cRowindicator)='04' or Coalesce(tblPortcashfin.cRowindicator,tblPortderfin.cRowindicator)='05' then '06' else '10' end ), tblDividend as (Select Ledger.Oowncode as cClientcode, '11' as cRowindicator, 0 as nFiramount, Sum(Ledger.damount-Ledger.Camount)*-1 as nSecamount From Ledger Ledger Inner Join Journal On Ledger.Firmnumber=Journal.Firmnumber and Ledger.Voucher=Journal.Jvnumber and Ledger.nFinancialyear=Journal.nFinancialyear Where Ledger.Firmnumber='NBS-000001' and Ledger.nFinancialyear=2024 and (Ledger.Oowncode='T5580011') and Ledger.Branchcode='T558' and Ledger.Dtoftran>=to_date('01/04/2023','dd/mm/yyyy') and Ledger.Dtoftran<=to_date('31/03/2024','dd/mm/yyyy') and Journal.nEntrytype=1 group by Ledger.Oowncode ), tblDirectDividend as (Select tblDirectdiv.cClientcode as cClientcode, '16' as cRowindicator, 0 as nFiramount, Sum(tblDirectdiv.nQuantity*tblDirectdiv.nRate)*-1 as nSecamount From tblDirectdiv tblDirectdiv Inner Join Ldfibs Ldfibs On tblDirectdiv.cFirmnumber = Ldfibs.Firmnumber and tblDirectdiv.cClientcode = Ldfibs.Oowncode Where tblDirectdiv.cFirmnumber='NBS-000001' and (tblDirectdiv.cClientcode='T5580011') and tblDirectdiv.dDtoftran>=to_date('01/04/2023','dd/mm/yyyy') and tblDirectdiv.dDtoftran<=to_date('31/03/2024','dd/mm/yyyy') group by tblDirectdiv.cClientcode ), tbltmpBillcharges as (Select Billcharges.Oowncode as cClientcode, Case When Billcharges.Egroup='FU' then '14' else '13' end as cRowindicator, Sum(Billcharges.Quantity*Billcharges.Final_Rat1) as nFiramount, 0 as nSecamount From Billcharges Billcharges Where Billcharges.Firmnumber='NBS-000001' and Billcharges.Brcode='T558' and (Billcharges.Oowncode='T5580011') and Billcharges.Dtoftran>=to_date('01/04/2023','dd/mm/yyyy') and Billcharges.Dtoftran<=to_date('31/03/2024','dd/mm/yyyy') group by Billcharges.Oowncode, Case When Billcharges.Egroup='FU' then '14' else '13' end ), tbltmpbillchgtotal as (Select tbltmpBillcharges.cClientcode as cClientcode, '12' as cRowindicator, 0 as nFiramount, Sum(tbltmpBillcharges.nFiramount) as nSecamount from tbltmpBillcharges tbltmpBillcharges group by tbltmpbillcharges.cClientcode ), tblMiscentries as ( Select Ledger.Oowncode as cClientcode, '15' as cRowindicator, 0 as nFiramount, Sum(Ledger.damount-Ledger.Camount)*-1 as nSecamount From Ledger Ledger Inner Join Journal On Ledger.Firmnumber=Journal.Firmnumber and Ledger.Voucher=Journal.Jvnumber and Ledger.nFinancialyear=Journal.nFinancialyear Where Ledger.Firmnumber='NBS-000001' and Ledger.nFinancialyear=2024 and (Ledger.Oowncode='T5580011') and Ledger.Branchcode='T558' and Ledger.Dtoftran>=to_date('01/04/2023','dd/mm/yyyy') and Ledger.Dtoftran<=to_date('31/03/2024','dd/mm/yyyy') and Journal.nEntrytype!=1 group by Ledger.Oowncode ), tbltempportalloc as (Select Coalesce(tblFinledger.cClientcode,tblPortcashfin.cClientcode) as cClientcode, '27' as cRowindicator, Sum(Nvl(tblFinledger.nFiramount,0)+Nvl(tblPortcashfin.nFiramount,0)) as nFiramount, 0 as nSecamount From tblFinledger tblFinledger Full Outer Join tblPortcashfin On tblFinledger.cClientcode=tblPortcashfin.cClientcode and tblFinledger.cRowindicator=tblPortcashfin.cRowindicator Where (tblFinledger.cRowindicator='26' or tblPortcashfin.cRowindicator='25') group by Coalesce(tblFinledger.cClientcode,tblPortcashfin.cClientcode) ), tbltemptotdays as (Select '18' as cRowindicator, (to_date('31/03/2024','dd/mm/yyyy') - to_date('01/04/2024','dd/mm/yyyy'))+1 as nSecamount From dual ), tblFinalloop as (Select tblReportdesc.cRowindicator as cRowindicator, tblReportdesc.cRowdesc as cRowdesc, Coalesce(tblReportdesc.cClientcode,tblOpenstk.cClientcode,tblCapinout.cClientcode,tblPortcashfin.cClientcode,tblPortderfin.cClientcode,tblCashplusderfinal.cClientcode,tblDividend.cClientcode,tbltmpbillcharges.cClientcode,tbltmpbillchgtotal.cClientcode,tblMiscentries.cClientcode,tblFinledger.cClientcode,tbltempPortalloc.cClientcode,tblDirectdividend.cClientcode) as cClientcode, Coalesce(tblOpenstk.nFiramount,tblCapinout.nFiramount,tblPortcashfin.nFiramount,tblPortderfin.nFiramount,tblCashplusderfinal.nFiramount,tblDividend.nFiramount,tbltmpBillcharges.nFiramount,tbltmpbillchgtotal.nFiramount,tblMiscentries.nFiramount,tblFinledger.nFiramount,tbltempPortalloc.nFiramount,tblDirectdividend.nFiramount) as nFiramount, Coalesce(tblOpenstk.nSecamount,tblCapinout.nSecamount,tblPortcashfin.nSecamount,tblPortderfin.nSecamount,tblCashplusderfinal.nSecamount,tblDividend.nSecamount,tbltmpBillcharges.nSecamount,tbltmpBillchgtotal.nSecamount,tblMiscentries.nSecamount,tblFinledger.nSecamount,tbltempPortalloc.nSecamount,tbltempTotdays.nSecamount,tbltempTotdays.nSecamount) as nSecamount From tblReportdesc tblReportdesc Left Outer Join tblOpenstk On tblReportdesc.cRowindicator=tblOpenstk.cRowindicator and tblReportdesc.cClientcode=tblOpenstk.cClientcode Left Outer Join tblCapinout On tblReportdesc.cRowindicator=tblCapinout.cRowindicator and tblReportdesc.cClientcode=tblCapinout.cClientcode Left Outer Join tblPortcashfin On tblReportdesc.cRowindicator=tblPortcashfin.cRowindicator and tblReportdesc.cClientcode=tblPortcashfin.cClientcode Left Outer Join tblPortderfin On tblReportdesc.cRowindicator=tblPortderfin.cRowindicator and tblReportdesc.cClientcode=tblPortderfin.cClientcode Left Outer Join tblCashplusderfinal On tblReportdesc.cRowindicator=tblCashplusderfinal.cRowindicator and tblReportdesc.cClientcode=tblCashplusderfinal.cClientcode Left Outer Join tblDividend On tblReportdesc.cRowindicator=tblDividend.cRowindicator and tblReportdesc.cClientcode=tblDividend.cClientcode Left Outer Join tbltmpBillcharges On tblReportdesc.cRowindicator=tbltmpBillcharges.cRowindicator and tblReportdesc.cClientcode=tbltmpBillcharges.cClientcode Left Outer Join tbltmpbillchgtotal On tblReportdesc.cRowindicator=tbltmpBillchgtotal.cRowindicator and tblReportdesc.cClientcode=tbltmpBillchgtotal.cClientcode Left Outer Join tblMiscentries On tblReportdesc.cRowindicator=tblMiscentries.cRowindicator and tblReportdesc.cClientcode=tblMiscentries.cClientcode Left Outer Join tblFinledger On tblReportdesc.cRowindicator=tblFinledger.cRowindicator and tblReportdesc.cClientcode=tblFinledger.cClientcode Left Outer Join tbltempPortalloc On tblReportdesc.cRowindicator=tbltempPortalloc.cRowindicator and tblReportdesc.cClientcode=tbltempPortalloc.cClientcode Left Outer Join tblDirectdividend On tblReportdesc.cRowindicator=tblDirectdividend.cRowindicator and tblReportdesc.cClientcode=tblDirectdividend.cClientcode Left Outer Join tbltemptotdays On tblReportdesc.cRowindicator=tbltempTotdays.cRowindicator ), tbltempporttotal as ( Select '17' as cRowindicator, tblFinalloop.cClientcode as cClientcode, Sum(tblFinalloop.nSecamount) as nTotalamount From tblFinalloop Where tblFinalloop.cRowindicator!='18' and nvl(trim(tblFinalloop.cClientcode),' ')!=' ' group by tblFinalloop.cClientcode ), tbltemptotalcapital as ( Select tblFinalloop.cClientcode as cClientcode, Sum(tblFinalloop.nSecamount) as nTotalamount From tblFinalloop tblFinalloop Where (tblFinalloop.cRowindicator='02' or tblFinalloop.cRowindicator='01') and nvl(trim(tblFinalloop.cClientcode),' ')!=' ' group by tblFinalloop.cClientcode ) Select tblFinalloop.cRowindicator as cRowindicator, tblFinalloop.cRowdesc as cRowdesc, tblFinalloop.cClientcode as cClientcode, tblFinalloop.nFiramount as nFiramount, Case When (tblFinalloop.cRowindicator=25 or tblFinalloop.cRowindicator=26) and tbltempPortalloc.nFiramount!=0 then Round(tblFinalloop.nFiramount/tbltempPortalloc.nFiramount*100,2) When tblFInalloop.cRowindicator='17' then tbltempporttotal.nTotalamount When tblFinalloop.cRowindicator='19' and tbltemptotalcapital.nTotalamount!=0 then Round((tbltempporttotal.nTotalamount-tbltemptotalcapital.nTotalamount)*100/tbltemptotalcapital.nTotalamount,2) When tblFinalloop.cRowindicator='20' and tbltemptotalcapital.nTotalamount!=0 then Round(((tbltempporttotal.nTotalamount-tbltemptotalcapital.nTotalamount)*100/tbltemptotalcapital.nTotalamount)*365/ ((to_date('31/03/2024','dd/mm/yyyy') - to_date('01/04/2024','dd/mm/yyyy')+1)),2) else tblFinalloop.nSecamount end as nSecamount From tblFinalloop Left Outer Join tbltempportalloc On tblFinalloop.cClientcode=tbltempportalloc.cClientcode Left Outer Join tbltempporttotal On tblFinalloop.cClientcode=tbltempporttotal.cClientcode Left Outer Join tbltemptotalcapital On tblFinalloop.cClientcode=tbltemptotalcapital.cClientcode Order by 1 Title : 01~Error Description : ORA-01476: divisor is equal to zero Method : getglobalportfolioLine : 44015 Message : getGlobalportfolio StackTrace : at OracleInternal.ServiceObjects.OracleConnectionImpl.VerifyExecution(Int32& cursorId, Boolean bThrowArrayBindRelatedErrors, SqlStatementType sqlStatementType, Int32 arrayBindCount, OracleException& exceptionForArrayBindDML, Boolean& hasMoreRowsInDB, Boolean bFirstIterationDone) at OracleInternal.ServiceObjects.OracleCommandImpl.ExecuteReader(String commandText, OracleParameterCollection paramColl, CommandType commandType, OracleConnectionImpl connectionImpl, OracleDataReaderImpl& rdrImpl, Int32 longFetchSize, Int64 clientInitialLOBFS, OracleDependencyImpl orclDependencyImpl, Int64[] scnForExecution, Int64[]& scnFromExecution, OracleParameterCollection& bindByPositionParamColl, Boolean& bBindParamPresent, Int64& internalInitialLOBFS, OracleException& exceptionForArrayBindDML, OracleConnection connection, OracleLogicalTransaction& oracleLogicalTransaction, IEnumerable`1 adrianParsedStmt, Boolean isDescribeOnly, Boolean isFromEF) at Oracle.ManagedDataAccess.Client.OracleCommand.ExecuteReader(Boolean requery, Boolean fillRequest, CommandBehavior behavior) at Oracle.ManagedDataAccess.Client.OracleDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable) at clientlevel.Thinclientlevel.Clientlogin.getglobalportfolio(DateTime tdStartdate, DateTime tdEnddate, DateTime tdPoadate, DateTime tdFinancialstartdate, Int32 tnAngleselection, String tcClientfilter, Cliole loLdcommon) in File25:line 44015 Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 561029120 Shut down : N Username : MOBBO Date/Time : 17/05/2024 9:04:51 PM Connection : Closed =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : T5580011 With tbltempReport as (Select '01' as cRowindicator, 'Opening Market Value' as cRowdesc From Dual Union All Select '02' as cRowindicator, 'Capital In(+)/Out(-)' as cRowdesc From Dual Union All Select '03' as cRowindicator, Rpad(' ',8)||'Realized Profit (+)/(-)' as cRowdesc From dual Union All Select '04' as cRowindicator, 'Cash Segment' as cRowdesc From dual Union All Select '05' as cRowindicator, 'Derivatives Segment' as cRowdesc From dual Union All Select '06' as cRowindicator, 'Total Realized Profit(+)/(-) ' as cRowdesc From dual Union All Select '07' as cRowindicator, Rpad(' ',8)||'Un-Realized Profit (+)/(-) ' as cRowdesc From dual Union All Select '08' as cRowindicator, 'Cash Segment' as cRowdesc From dual Union All Select '09' as cRowindicator, 'Derivatives Segment' as cRowdesc From dual Union All Select '10' as cRowindicator, 'Total Un-Realized Profit(+)/(-) ' as cRowdesc From dual Union All Select '11' as cRowindicator, 'Total Dividend Amount' as cRowdesc From dual Union All Select '12' as cRowindicator, Rpad(' ',8)||'Statutory Charges' as cRowdesc From dual Union All Select '13' as cRowindicator, 'Cash Segment' as cRowdesc From dual Union All Select '14' as cRowindicator, 'Derivatives Segment' as cRowdesc From dual Union All Select '15' as cRowindicator, 'Misc. JV Entries' as cRowdesc From dual Union All Select '16' as cRowindicator, 'Direct Dividend Credit' as cRowdesc From dual Union All Select '17' as cRowindicator, 'Total Portfolio Allocation' as cRowdesc From dual Union All Select '18' as cRowindicator, 'Total No. of Days' as cRowdesc From dual Union All Select '19' as cRowindicator, 'Absolute Return' as cRowdesc From dual Union All Select '20' as cRowindicator, 'Annualized Return' as cRowdesc From dual Union All Select '24' as cRowindicator, Rpad(' ',8)||'Portfolio Allocation' as cRowdesc From dual Union All Select '25' as cRowindicator, 'Equity' as cRowdesc From dual Union All Select '26' as cRowindicator, 'Cash and Equivalent' as cRowdesc From dual Union All Select '27' as cRowindicator, 'Total Portfolio Allocation' as cRowdesc From dual ), tblReportdesc as (Select Ldfibs.Oowncode as cClientcode, tbltempReport.* From Ldfibs Ldfibs Left Outer Join tbltempReport On 1=1 Where Ldfibs.Firmnumber='NBS-000001' and (Ldfibs.Oowncode='T5580011') and Ldfibs.Brcode='T558' ), tblOpendet as (Select Ledger.Oowncode as cClientcode, '01' as cRowindicator, Sum(Ledger.Damount-Ledger.Camount)*-1 as nSecamount From Ledger Ledger Where Ledger.Firmnumber='NBS-000001' and Ledger.nFinancialyear=2024 and (Ledger.Oowncode='T5580011') and Ledger.Branchcode='T558' and Substr(Ledger.Voucher,1,4)='OPNG' group by Ledger.Oowncode Union All Select Sauda.Oowncode as cClientcode, '01' as cRowindicator, Sum(Sauda.Quantity*Sauda.Market) as nSecamount From Sauda Sauda Where Sauda.Egroup='OK' and Sauda.Firmnumber = 'NBS-000001' and (Sauda.Oowncode='T5580011') and Sauda.Brcode='T558' group by Sauda.Oowncode ), tblOpenstk as (Select tblOpendet.cClientcode as cClientcode, Max(tblOpendet.cRowindicator) as cRowindicator, 0 as nFiramount, Sum(tblOpendet.nSecamount) as nSecamount From tblOpendet tblOpendet group by tblOpendet.cClientcode), tblCapinout as (Select Ledger.Oowncode as cClientcode, '02' as cRowindicator, 0 as nFiramount, Sum(Ledger.Damount-Ledger.Camount)*-1 as nSecamount From Ledger Ledger Where Ledger.Firmnumber='NBS-000001' and Ledger.nFinancialyear=2024 and (Ledger.Oowncode='T5580011') and Ledger.Branchcode='T558' and Ledger.Dtoftran>=to_date('01/04/2023','dd/mm/yyyy') and Ledger.Dtoftran<=to_date('31/03/2024','dd/mm/yyyy') and (Substr(Ledger.Voucher,1,2)='RE' or Substr(Ledger.Voucher,1,2)='PY') group by Ledger.Oowncode ), tblFinledger as (Select Ledger.Oowncode as cClientcode, '26' as cRowindicator, Sum(Ledger.Damount-Ledger.Camount)*-1 as nFiramount, 0 as nSecamount From Ledger Ledger Where Ledger.Firmnumber='NBS-000001' and Ledger.nFinancialyear=2024 and (Ledger.Oowncode='T5580011') and Ledger.Branchcode='T558' and Ledger.Dtoftran>=to_date('01/04/2023','dd/mm/yyyy') and Ledger.Dtoftran<=to_date('31/03/2024','dd/mm/yyyy') group by Ledger.Oowncode ), tblCashinternal as (Select Sauda.Oowncode as cClientcode, Sauda.Compcode as cScripcode, Sauda.Dtoftran as dBuydate, Sauda.BuySell as cBuysell, Sum(Sauda.Quantity) as nBuyquantity, Case When Sum(Sauda.Brokpercontract) = 0 Then Avg(Sauda.Final_Rat1) Else Case When Sauda.BuySell = 'B' Then Round(((Sum(Sauda.Quantity) * Avg(Sauda.Final_Rat1)) + Sum(Sauda.Brokpercontract)) / Sum(Sauda.Quantity), 10) Else Round(((Sum(Sauda.Quantity) * Avg(Sauda.Final_Rat1)) - Sum(Sauda.Brokpercontract)) / Sum(Sauda.Quantity), 10) End End as nBuynetrate, Sum(Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, Sauda.Quantity * -1))) Over(Partition By Sauda.Oowncode, Sauda.Compcode Order By Sauda.Dtoftran, Sauda.Final_Rat1 rows between current row and unbounded following) as nRunningqty, Sum(Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, 0))) Over(Partition By Sauda.Oowncode, Sauda.Compcode Order By Sauda.Dtoftran, Sauda.Final_Rat1 rows between current row and unbounded following) as nRunningbuytotal, Sum(Sum(Decode(Sauda.Buysell, 'S', Sauda.Quantity, 0))) Over(Partition By Sauda.Oowncode, Sauda.Compcode Order By Sauda.Dtoftran, Sauda.Final_Rat1 rows between current row and unbounded following) as nRunningselltotal, Sum(Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, 0))) Over(Partition By Sauda.Oowncode, Sauda.Compcode) as nSummarybuy, Sum(Sum(Decode(Sauda.Buysell, 'S', Sauda.Quantity, 0))) Over(Partition By Sauda.Oowncode, Sauda.Compcode) as nSummarysell, Sum(Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, 0)) * Case When Sum(Sauda.Brokpercontract) = 0 Then Avg(Sauda.Final_Rat1) Else Case When Sauda.BuySell = 'B' Then Round(((Sum(Sauda.Quantity) * Avg(Sauda.Final_Rat1)) + Sum(Sauda.Brokpercontract)) / Sum(Sauda.Quantity), 10) Else 0 End End) Over(Partition By Sauda.Oowncode, Sauda.Compcode) as nSumBuyamount, Sum(Sum(Decode(Sauda.Buysell, 'S', Sauda.Quantity, 0)) * Case When Sum(Sauda.Brokpercontract) = 0 Then Avg(Sauda.Final_Rat1) Else Case When Sauda.BuySell = 'B' Then 0 Else Round(((Sum(Sauda.Quantity) * Avg(Sauda.Final_Rat1)) - Sum(Sauda.Brokpercontract)) / Sum(Sauda.Quantity), 10) End End) Over(Partition By Sauda.Oowncode, Sauda.Compcode) as nSumSellamount, Sum(Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, Sauda.Quantity * -1))) Over(Partition By Sauda.Oowncode, Sauda.Compcode) As nNetquantity From Sauda Sauda Where Sauda.Firmnumber='NBS-000001' and Sauda.Egroup!='YC' and Sauda.Egroup != 'LB' and Sauda.Egroup != 'SR' and Sauda.Egroup != 'LA' and Sauda.Sterminal != '99999' and Sauda.Dtoftran 0 Then Case When tblCashinternal.nRunningbuytotal > tblCashinternal.nNetquantity Then tblCashinternal.nNetquantity + tblCashinternal.nBuyquantity - tblCashinternal.nRunningbuytotal Else tblCashinternal.nBuyquantity End When tblCashinternal.nNetquantity < 0 Then Case When Abs(tblCashinternal.nRunningselltotal) > Abs(tblCashinternal.nNetquantity) Then tblCashinternal.nNetquantity - tblCashinternal.nBuyquantity + tblCashinternal.nRunningselltotal Else tblCashinternal.nBuyquantity * -1 End End) as nOpStockquantity, Sum((Case When tblCashinternal.nNetquantity = 0 Then 0 When tblCashinternal.nNetquantity > 0 Then Case When tblCashinternal.nRunningbuytotal > tblCashinternal.nNetquantity Then tblCashinternal.nNetquantity + tblCashinternal.nBuyquantity - tblCashinternal.nRunningbuytotal Else tblCashinternal.nBuyquantity End When tblCashinternal.nNetquantity < 0 Then Case When Abs(tblCashinternal.nRunningselltotal) > Abs(tblCashinternal.nNetquantity) Then tblCashinternal.nNetquantity - tblCashinternal.nBuyquantity + tblCashinternal.nRunningselltotal Else tblCashinternal.nBuyquantity * -1 End End) * tblCashinternal.nBuynetrate) as nOpStockAmount from tblCashinternal Where (tblCashinternal.nNetquantity > 0 And tblCashinternal.cBuysell = 'B' And tblCashinternal.nRunningbuytotal <= tblCashinternal.nNetquantity + tblCashinternal.nBuyquantity) or (tblCashinternal.nNetquantity < 0 and tblCashinternal.cBuysell = 'S' and Abs(tblCashinternal.nRunningselltotal) <= Abs(tblCashinternal.nNetquantity) + tblCashinternal.nBuyquantity) Group By tblCashinternal.cClientcode, tblCashinternal.cScripcode), tblCashinternal1 as (Select Sauda.Oowncode as cClientcode, Sauda.Compcode as cScripcode, Sauda.Dtoftran as dBuydate, Sauda.BuySell as cBuysell, Sum(Sauda.Quantity) as nBuyquantity, Case When Sum(Sauda.Brokpercontract) = 0 Then Avg(Sauda.Final_Rat1) Else Case When Sauda.BuySell = 'B' Then Round(((Sum(Sauda.Quantity) * Avg(Sauda.Final_Rat1)) + Sum(Sauda.Brokpercontract)) / Sum(Sauda.Quantity), 10) Else Round(((Sum(Sauda.Quantity) * Avg(Sauda.Final_Rat1)) - Sum(Sauda.Brokpercontract)) / Sum(Sauda.Quantity), 10) End End as nBuynetrate, Sum(Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, Sauda.Quantity * -1))) Over(Partition By Sauda.Oowncode, Sauda.Compcode Order By Sauda.Dtoftran, Sauda.Final_Rat1 rows between current row and unbounded following) as nRunningqty, Sum(Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, 0))) Over(Partition By Sauda.Oowncode, Sauda.Compcode Order By Sauda.Dtoftran, Sauda.Final_Rat1 rows between current row and unbounded following) as nRunningbuytotal, Sum(Sum(Decode(Sauda.Buysell, 'S', Sauda.Quantity, 0))) Over(Partition By Sauda.Oowncode, Sauda.Compcode Order By Sauda.Dtoftran, Sauda.Final_Rat1 rows between current row and unbounded following) as nRunningselltotal, Sum(Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, 0))) Over(Partition By Sauda.Oowncode, Sauda.Compcode) as nSummarybuy, Sum(Sum(Decode(Sauda.Buysell, 'S', Sauda.Quantity, 0))) Over(Partition By Sauda.Oowncode, Sauda.Compcode) as nSummarysell, Sum(Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, 0)) * Case When Sum(Sauda.Brokpercontract) = 0 Then Avg(Sauda.Final_Rat1) Else Case When Sauda.BuySell = 'B' Then Round(((Sum(Sauda.Quantity) * Avg(Sauda.Final_Rat1)) + Sum(Sauda.Brokpercontract)) / Sum(Sauda.Quantity), 10) Else 0 End End) Over(Partition By Sauda.Oowncode, Sauda.Compcode) as nSumBuyamount, Sum(Sum(Decode(Sauda.Buysell, 'S', Sauda.Quantity, 0)) * Case When Sum(Sauda.Brokpercontract) = 0 Then Avg(Sauda.Final_Rat1) Else Case When Sauda.BuySell = 'B' Then 0 Else Round(((Sum(Sauda.Quantity) * Avg(Sauda.Final_Rat1)) - Sum(Sauda.Brokpercontract)) / Sum(Sauda.Quantity), 10) End End) Over(Partition By Sauda.Oowncode, Sauda.Compcode) as nSumSellamount, Sum(Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, Sauda.Quantity * -1))) Over(Partition By Sauda.Oowncode, Sauda.Compcode) As nNetquantity From Sauda Sauda Where Sauda.Firmnumber='NBS-000001' and Sauda.Egroup!='YC' and Sauda.Egroup != 'LB' and Sauda.Egroup != 'SR' and Sauda.Egroup != 'LA' and Sauda.Sterminal != '99999' and Sauda.Dtoftran<=to_date('31/03/2024','dd/mm/yyyy') and Sauda.Brcode='T558' and (Sauda.Oowncode='T5580011') group by Sauda.Oowncode, Sauda.Dtoftran, Sauda.Final_Rat1, Sauda.buysell, Sauda.Compcode), tblClosing as (Select tblCashinternal1.cClientcode as cClientcode, tblCashinternal1.cScripcode as cScripcode, Sum(Case When tblCashinternal1.nNetquantity = 0 Then 0 When tblCashinternal1.nNetquantity > 0 Then Case When tblCashinternal1.nRunningbuytotal > tblCashinternal1.nNetquantity Then tblCashinternal1.nNetquantity + tblCashinternal1.nBuyquantity - tblCashinternal1.nRunningbuytotal Else tblCashinternal1.nBuyquantity End When tblCashinternal1.nNetquantity < 0 Then Case When Abs(tblCashinternal1.nRunningselltotal) > Abs(tblCashinternal1.nNetquantity) Then tblCashinternal1.nNetquantity - tblCashinternal1.nBuyquantity + tblCashinternal1.nRunningselltotal Else tblCashinternal1.nBuyquantity * -1 End End) AS nCLStockquantity, Sum((Case When tblCashinternal1.nNetquantity = 0 Then 0 When tblCashinternal1.nNetquantity > 0 Then Case When tblCashinternal1.nRunningbuytotal > tblCashinternal1.nNetquantity Then tblCashinternal1.nNetquantity + tblCashinternal1.nBuyquantity - tblCashinternal1.nRunningbuytotal Else tblCashinternal1.nBuyquantity End When tblCashinternal1.nNetquantity < 0 Then Case When Abs(tblCashinternal1.nRunningselltotal) > Abs(tblCashinternal1.nNetquantity) Then tblCashinternal1.nNetquantity - tblCashinternal1.nBuyquantity + tblCashinternal1.nRunningselltotal Else tblCashinternal1.nBuyquantity * -1 End End) * tblCashinternal1.nBuynetrate) as nClStockAmount from tblCashinternal1 Where (tblCashinternal1.nNetquantity > 0 And tblCashinternal1.cBuysell = 'B' And tblCashinternal1.nRunningbuytotal <= tblCashinternal1.nNetquantity + tblCashinternal1.nBuyquantity) or (tblCashinternal1.nNetquantity < 0 and tblCashinternal1.cBuysell = 'S' and Abs(tblCashinternal1.nRunningselltotal) <= Abs(tblCashinternal1.nNetquantity) + tblCashinternal1.nBuyquantity) Group By tblCashinternal1.cClientcode, tblCashinternal1.cScripcode), tblBuYSell as (Select Sauda.Oowncode as cClientcode, Sauda.Compcode as cScripcode, Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, 0)) as nbuyQty, Sum(Decode(Sauda.Buysell, 'S', Sauda.Quantity, 0)) as nsellQty, Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity * Sauda.Final_Rat1 , 0)+Case When Sauda.Buysell='B' then Sauda.Brokpercontract else 0 end) as nBuyamount, Sum(Decode(Sauda.Buysell, 'S', Sauda.Quantity * Sauda.Final_Rat1 , 0)-Case When Sauda.Buysell='S' then Sauda.Brokpercontract else 0 end) as nSellamount From Sauda Sauda Where Sauda.Firmnumber='NBS-000001' and Sauda.Egroup!='YC' and Sauda.Egroup != 'LB' and Sauda.Egroup != 'SR' and Sauda.Egroup != 'LA' and Sauda.Sterminal != '99999' and Sauda.Dtoftran>=to_date('01/04/2023','dd/mm/yyyy') and Sauda.Dtoftran<=to_Date('31/03/2024','dd/mm/yyyy') and Sauda.Brcode='T558' and (Sauda.Oowncode='T5580011') group by Sauda.Oowncode, Sauda.Compcode), tblCashcost as (Select Coalesce(tblOpening.cClientcode,tblClosing.cClientcode,tblBuysell.cClientcode) as cClientcode, Coalesce(tblOpening.cScripcode,tblClosing.cScripcode,tblBuysell.cScripcode) as cScripcode, Nvl(tblOpening.nOpstockquantity,0) as nOpstockquantity, Nvl(tblOpening.nOpstockamount,0) as nOpstockamount, Case When Nvl(tblOpening.nOpstockquantity,0)!=0 then Round(Nvl(tblOpening.nOpstockamount,0)/Nvl(tblOpening.nOpstockquantity,0),4) else 0 end as nOpstockavg, Nvl(tblBuysell.nBuyqty,0) as nPrePurchqty, Nvl(tblBuysell.nBuyamount,0) as nPrePurchvalue, Case When Nvl(tblBuysell.nBuyqty,0) !=0 then Round(Nvl(tblBuysell.nBuyamount,0)/Nvl(tblBuysell.nBuyqty,0),4) else 0 end as nPrePurchavg, Nvl(tblBuysell.nSellQty, 0) as nPreSellqty, Nvl(tblBuysell.nSellamount, 0) as nPreSellvalue, Case When Nvl(tblBuysell.nSellQty, 0) != 0 then Round(Nvl(tblBuysell.nSellamount, 0) / Nvl(tblBuysell.nSellQty, 0), 4) else 0 end as nPreSellavg, Least((Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockquantity, 0) + Nvl(tblBuysell.nBuyqty, 0) Else Nvl(tblBuysell.nBuyqty, 0) End), (Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockquantity, 0)) + Nvl(tblBuysell.nSellqty, 0) Else Nvl(tblBuysell.nSellqty, 0) End)) as nPurchqty, Round((Case When (Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockquantity, 0) + Nvl(tblBuysell.nBuyqty, 0) Else Nvl(tblBuysell.nBuyqty, 0) End) <= (Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockquantity, 0)) + Nvl(tblBuysell.nSellqty, 0) Else Nvl(tblBuysell.nSellqty, 0) End) Then Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockAmount, 0) + Nvl(tblBuysell.nBuyAmount, 0) Else Nvl(tblBuysell.nBuyAmount, 0) End Else Nvl(tblBuysell.nBuyAmount, 0) + Nvl(tblOpening.nOpstockAmount, 0) - nvl(tblClosing.nClStockAmount, 0) End), 2) as nPurchvalue, Round((Case When Least((Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockquantity, 0) + Nvl(tblBuysell.nBuyqty, 0) Else Nvl(tblBuysell.nBuyqty, 0) End), (Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockquantity, 0)) + Nvl(tblBuysell.nSellqty, 0) Else Nvl(tblBuysell.nSellqty, 0) End)) != 0 Then (Case When (Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockquantity, 0) + Nvl(tblBuysell.nBuyqty, 0) Else Nvl(tblBuysell.nBuyqty, 0) End) <= (Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockquantity, 0)) + Nvl(tblBuysell.nSellqty, 0) Else Nvl(tblBuysell.nSellqty, 0) End) Then Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockAmount, 0) + Nvl(tblBuysell.nBuyAmount, 0) Else Nvl(tblBuysell.nBuyAmount, 0) End Else Nvl(tblBuysell.nBuyAmount, 0) + Nvl(tblOpening.nOpstockAmount, 0) - nvl(tblClosing.nClStockAmount, 0) End) / (Least((Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockquantity, 0) + Nvl(tblBuysell.nBuyqty, 0) Else Nvl(tblBuysell.nBuyqty, 0) End), (Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockquantity, 0)) + Nvl(tblBuysell.nSellqty, 0) Else Nvl(tblBuysell.nSellqty, 0) End))) Else 0 End), 4) as nPurchavg, Least((Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockquantity, 0) + Nvl(tblBuysell.nBuyqty, 0) Else Nvl(tblBuysell.nBuyqty, 0) End), (Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockquantity, 0)) + Nvl(tblBuysell.nSellqty, 0) Else Nvl(tblBuysell.nSellqty, 0) End)) as nSalesqty, Round((Case When (Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockquantity, 0) + Nvl(tblBuysell.nBuyqty, 0) Else Nvl(tblBuysell.nBuyqty, 0) End) >= (Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockquantity, 0)) + Nvl(tblBuysell.nSellqty, 0) Else Nvl(tblBuysell.nSellqty, 0) End) Then Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockAmount, 0)) + Nvl(tblBuysell.nSellAmount, 0) Else Nvl(tblBuysell.nSellAmount, 0) End Else Nvl(tblBuysell.nSellAmount, 0) - Nvl(tblOpening.nOpstockAmount, 0) + nvl(tblClosing.nClStockAmount, 0) End), 2) as nSalesvalue, Round((Case When Least((Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockquantity, 0) + Nvl(tblBuysell.nBuyqty, 0) Else Nvl(tblBuysell.nBuyqty, 0) End), (Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockquantity, 0)) + Nvl(tblBuysell.nSellqty, 0) Else Nvl(tblBuysell.nSellqty, 0) End)) != 0 Then (Case When (Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockquantity, 0) + Nvl(tblBuysell.nBuyqty, 0) Else Nvl(tblBuysell.nBuyqty, 0) End) >= (Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockquantity, 0)) + Nvl(tblBuysell.nSellqty, 0) Else Nvl(tblBuysell.nSellqty, 0) End) Then Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockAmount, 0)) + Nvl(tblBuysell.nSellAmount, 0) Else Nvl(tblBuysell.nSellAmount, 0) End Else Nvl(tblBuysell.nSellAmount, 0) - Nvl(tblOpening.nOpstockAmount, 0) + nvl(tblClosing.nClStockAmount, 0) End) / (Least((Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockquantity, 0) + Nvl(tblBuysell.nBuyqty, 0) Else Nvl(tblBuysell.nBuyqty, 0) End), (Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockquantity, 0)) + Nvl(tblBuysell.nSellqty, 0) Else Nvl(tblBuysell.nSellqty, 0) End))) ELse 0 End), 4) as nSalesavg, Nvl(tblClosing.nClstockquantity, 0) as nOsstock, Nvl(tblClosing.nClstockamount, 0) as nOsstockvalue, Case When Nvl(tblClosing.nClstockquantity, 0) != 0 then Round(Nvl(tblClosing.nClstockamount, 0) / Nvl(tblClosing.nClstockquantity, 0), 4) else 0 end as nOsstockavg, (nvl(tblBuySell.nSellAmount, 0) - nvl(tblOpening.nOpStockAmount, 0) - nvl(tblBuySell.nBuyAmount, 0) + nvl(tblClosing.nClStockAmount, 0)) as nProfitloss, ((Market.Market * nvl(tblClosing.nClstockquantity, 0)) - Nvl(tblClosing.nClstockamount, 0)) As nUnrealprlo, (nvl(tblBuySell.nSellAmount, 0) - nvl(tblOpening.nOpStockAmount, 0) - nvl(tblBuySell.nBuyAmount, 0) + nvl(tblClosing.nClStockAmount, 0)) + ((Market.Market * nvl(tblClosing.nClstockquantity, 0)) - Nvl(tblClosing.nClstockamount, 0)) As nOverallprlo, Market.Market as nMarketrate, Market.Market*Nvl(tblClosing.nClstockquantity,0) As nMarketvalue from tblOPening tblOpening Full Join TblClosing on tblOpening.cclientcode = tblclosing.cclientcode and tblOPening.cScripcode = tblClosing.cScripcode Full Join TblBuySell on tblBuySell.cclientcode = coalesce(tblOpening.cclientcode, tblclosing.cclientcode) and tblBuySell.cScripcode = coalesce(tblOPening.cScripcode, tblClosing.cScripcode) Left Outer Join Market Market On Market.Firmnumber='NBS-000001' and Market.code=coalesce(tblOpening.cScripcode, tblclosing.cScripcode, tblBuysell.cScripcode) ), tblOpendet as (Select Ledger.Oowncode as cClientcode, '01' as cRowindicator, Sum(Ledger.Damount-Ledger.Camount)*-1 as nSecamount From Ledger Ledger Where Ledger.Firmnumber='NBS-000001' and Ledger.nFinancialyear = 2024 and (Ledger.Oowncode='T5580011') and Ledger.Branchcode='T558' and Substr(Ledger.Voucher,1,4)='OPNG' group by Ledger.Oowncode Union All Select tblCashcost.cClientcode as cClientcode, '01' as cRowindicator, Sum(tblCashcost.nOpstockamount) as nSecamount From tblCashcost tblCashcost group by tblCashcost.cClientcode ), tblOpenstk as (Select tblOpendet.cClientcode as cClientcode, Max(tblOpendet.cRowindicator) as cRowindicator, 0 as nFiramount, Sum(tblOpendet.nSecamount) as nSecamount From tblOpendet tblOpendet group by tblOpendet.cClientcode), tblPortcashfin as (Select tblCashcost.cClientcode as cClientcode, '04' as cRowindicator, Sum(tblCashcost.nProfitloss) as nFiramount, 0 as nSecamount From tblCashcost tblCashcost group by tblCashcost.cClientcode Union All Select tblCashcost.cClientcode as cClientcode, '25' as cRowindicator, Sum(tblCashcost.nMarketvalue) as nFiramount, 0 as nSecamount From tblCashcost tblCashcost group by tblCashcost.cClientcode Union All Select tblCashcost.cClientcode as cClientcode, '08' as cRowindicator, Sum(tblCashcost.nUnrealprlo) as nFiramount, 0 as nSecamount From tblCashcost tblCashcost group by tblCashcost.cClientcode ), tblFointernal as (Select Fosauda.Oowncode as cClientcode, Fosauda.Compcode as cScripcode, Fosauda.Strikeprice as nStrikeprice, Fosauda.Optiontype as cOptiontype, Company.Fibsacct as cScripname, Company.Expirydate as dExpirydate, Exchange.Operation as cOperation, Company.Instrutyp as cInstrutyp, Company.nBaseunit as nBaseunit, Company.cUnitofmeasurement as cUnitofmeasurement, Company.cUnitofTrading as cUnitofTrading, Company.nTradeablelot as nTradeablelot, Company.nPricenumerator as nPricenumerator, Company.nPricedenominator as nPricedenominator, Company.nGeneralnumerator as nGeneralnumerator, Company.nGeneraldenominator as nGeneraldenominator, Fosauda.Dtoftran as dBuydate, Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') or Fosauda.Optiontype != 'PO' Then Fosauda.Buysell else Case When Fosauda.Buysell = 'B' Then 'S' Else 'B' End end as cBuysell, Sum(Fosauda.quantity) as nBuyquantity, Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') Then Case When Sum(Fosauda.nValuebrokerage) = 0 then Avg(Fosauda.Final_Rat1) else Case When Fosauda.BuySell = 'B' Then Round(((Sum(Fosauda.Quantity) * Avg(Fosauda.Final_Rat1)) + Sum(Fosauda.nValuebrokerage)) / Sum(Fosauda.Quantity), 10) Else Round(((Sum(Fosauda.Quantity) * Avg(Fosauda.Final_Rat1)) - Sum(Fosauda.nValuebrokerage)) / Sum(Fosauda.Quantity), 10) End End Else Case When Fosauda.Buysell = 'B' Then Avg(Fosauda.Final_rat1) - Avg(Fosauda.Strikeprice) else Avg(Fosauda.Strikeprice) - Avg(Fosauda.Final_rat1) End End as nBuynetrate, Sum(Sum(Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') or Fosauda.Optiontype != 'PO' Then Decode(Fosauda.Buysell, 'B', Fosauda.Quantity, Fosauda.Quantity * -1) Else Decode(Fosauda.Buysell, 'S', Fosauda.Quantity, Fosauda.Quantity * -1) End)) Over(Partition By Fosauda.Oowncode, Company.Fibsacct, Fosauda.Strikeprice, Fosauda.Optiontype Order By Fosauda.Dtoftran, Fosauda.Final_Rat1 rows between current row and unbounded following) as nRunningqty, Sum(Sum(Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') or Fosauda.optiontype != 'PO' Then Decode(Fosauda.Buysell, 'B', Fosauda.Quantity, 0) Else Decode(Fosauda.Buysell, 'S', Fosauda.Quantity, 0) End)) Over(Partition By Fosauda.Oowncode, Company.Fibsacct, Fosauda.Strikeprice, Fosauda.Optiontype Order By Fosauda.Dtoftran, Fosauda.Final_Rat1 rows between current row and unbounded following) as nRunningbuytotal, Sum(Sum(Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') or Fosauda.Optiontype != 'PO' Then Decode(Fosauda.Buysell, 'S', Fosauda.Quantity, 0) Else Decode(Fosauda.Buysell, 'B', Fosauda.Quantity, 0) End)) Over(Partition By Fosauda.Oowncode, Company.Fibsacct, Fosauda.Strikeprice, Fosauda.Optiontype Order By Fosauda.Dtoftran, Fosauda.Final_Rat1 rows between current row and unbounded following) as nRunningselltotal, Sum(Sum(Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') or Fosauda.optiontype != 'PO' Then Decode(Fosauda.Buysell, 'B', Fosauda.Quantity, 0) Else Decode(Fosauda.Buysell, 'S', Fosauda.Quantity, 0) End)) Over(Partition By Fosauda.Oowncode, Company.Fibsacct, Fosauda.Strikeprice, Fosauda.Optiontype) as nSummarybuy, Sum(Sum(Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') or Fosauda.optiontype != 'PO' Then Decode(Fosauda.Buysell, 'S', Fosauda.Quantity, 0) Else Decode(Fosauda.Buysell, 'B', Fosauda.Quantity, 0) End)) Over(Partition By Fosauda.Oowncode, Company.Fibsacct, Fosauda.Strikeprice, Fosauda.Optiontype) as nSummarysell, Sum(Sum(Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') or Fosauda.Optiontype != 'PO' Then Decode(Fosauda.Buysell, 'B', Fosauda.Quantity, 0) Else Decode(Fosauda.Buysell, 'S', Fosauda.Quantity, 0) End) * Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') Then Case When Sum(Fosauda.nValuebrokerage) = 0 then Avg(Fosauda.Final_Rat1) else Case When Fosauda.BuySell = 'B' Then Round(((Sum(Fosauda.Quantity) * Avg(Fosauda.Final_Rat1)) + Sum(Fosauda.nValuebrokerage)) / Sum(Fosauda.Quantity), 10) Else Round(((Sum(Fosauda.Quantity) * Avg(Fosauda.Final_Rat1)) - Sum(Fosauda.nValuebrokerage)) / Sum(Fosauda.Quantity), 10) End End Else Abs(Avg(Fosauda.Final_Rat1) - Avg(fosauda.strikeprice)) End) Over(Partition By Fosauda.Oowncode, Company.Fibsacct, Fosauda.Strikeprice, Fosauda.Optiontype) as nSumBuyamount, Sum(Sum(Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') or Fosauda.Optiontype != 'PO' Then Decode(Fosauda.Buysell, 'S', Fosauda.Quantity, 0) Else Decode(Fosauda.Buysell, 'B', Fosauda.Quantity, 0) End) * Case When (Fosauda.saudatype != 'AS' and Fosauda.Saudatype != 'EX') Then Case When Sum(Fosauda.nValuebrokerage) = 0 then Avg(Fosauda.Final_Rat1) else Case When Fosauda.BuySell = 'B' Then Round(((Sum(Fosauda.Quantity) * Avg(Fosauda.Final_Rat1)) + Sum(Fosauda.nValuebrokerage)) / Sum(Fosauda.Quantity), 10) Else Round(((Sum(Fosauda.Quantity) * Avg(Fosauda.Final_Rat1)) - Sum(Fosauda.nValuebrokerage)) / Sum(Fosauda.Quantity), 10) End End Else Abs(Avg(Fosauda.Final_Rat1) - Avg(fosauda.strikeprice)) End) Over(Partition By Fosauda.Oowncode, Company.Fibsacct, Fosauda.Strikeprice, Fosauda.Optiontype) as nSumSellamount, Sum(Sum(Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') or Fosauda.optiontype != 'PO' Then Decode(Fosauda.Buysell, 'B', Fosauda.Quantity, Fosauda.Quantity * -1) Else Decode(Fosauda.Buysell, 'S', Fosauda.Quantity, Fosauda.Quantity * -1) End)) Over(Partition By Fosauda.Oowncode, Company.Fibsacct, Fosauda.Strikeprice, Fosauda.Optiontype) As nNetquantity From Fosauda Fosauda Inner Join Company Company On Fosauda.firmnumber = Company.Firmnumber and Fosauda.Compcode = Company.oowncode Inner Join Exchange Exchange On Fosauda.Firmnumber = Exchange.Firmnumber and Fosauda.Exchcode = Exchange.Code Where Fosauda.Firmnumber = 'NBS-000001' and Fosauda.Egroup != 'YF' and Fosauda.Egroup != 'LB' and Fosauda.Egroup != 'SR' and Fosauda.Egroup != 'LA' and Fosauda.Sterminal != '99999' and (Fosauda.Oowncode='T5580011') and Fosauda.Brcode='T558' and Fosauda.Dtoftran>=to_date('01/04/2023','dd/mm/yyyy') and Fosauda.Dtoftran<=to_date('31/03/2024','dd/mm/yyyy') and ((Fosauda.Saudatype != 'B/' and Fosauda.Orignalno = 0) or (Fosauda.Saudatype = 'B/' and (Fosauda.Orignalno = -99 or Fosauda.Dtoftran=to_date('01/04/2023','dd/mm/yyyy')))) group by Fosauda.Oowncode, Company.Fibsacct, Company.Expirydate, Exchange.Operation, Company.Instrutyp, Company.nBaseunit, Company.cUnitofmeasurement, Company.cUnitofTrading, Company.nTradeablelot, Company.nPricenumerator, Company.nPricedenominator, Company.nGeneralnumerator, Company.nGeneraldenominator, Fosauda.Dtoftran, Fosauda.Final_Rat1, Fosauda.buysell, Fosauda.Compcode, Fosauda.Strikeprice, Fosauda.Saudatype, Fosauda.Optiontype), tblFocost as (Select tblFointernal.cClientcode as cClientcode, tblFointernal.cScripcode as cScripcode, tblFointernal.nStrikeprice as nStrikeprice, tblFointernal.cOptiontype as cOptiontype, tblFointernal.cScripname as cScripname, tblFointernal.cOperation as cOperation, tblFoInternal.cInstrutyp as cInstrutyp, tblFoInternal.nBaseunit as nBaseunit, tblFoInternal.cUnitofmeasurement as cUnitofmeasurement, tblFoInternal.cUnitofTrading as cUnitofTrading, tblFoInternal.nTradeablelot as nTradeablelot, tblFoInternal.nPricenumerator as nPricenumerator, tblFoInternal.nPricedenominator as nPricedenominator, tblFoInternal.nGeneralnumerator as nGeneralnumerator, tblFoInternal.nGeneraldenominator as nGeneraldenominator, tblFointernal.dExpirydate as dExpirydate, tblFointernal.dBuydate as dBuydate, tblFointernal.nBuynetrate as nBuynetrate, Case When tblFointernal.nNetquantity = 0 Then 0 When tblFointernal.nNetquantity > 0 Then Case When tblFointernal.nRunningbuytotal > tblFointernal.nNetquantity Then tblFointernal.nNetquantity + tblFointernal.nBuyquantity - tblFointernal.nRunningbuytotal Else tblFointernal.nBuyquantity End When tblFointernal.nNetquantity < 0 Then Case When abs(tblFointernal.nRunningselltotal) > abs(tblFointernal.nNetquantity) Then tblFointernal.nNetquantity - tblFointernal.nBuyquantity + tblFointernal.nRunningselltotal Else tblFointernal.nBuyquantity * -1 End End AS nStockquantity, tblFointernal.nSummarybuy as nSummarybuy, tblFointernal.nSumBuyamount as nSumbuyamount, tblFointernal.nSummarysell as nSummarysell, tblFointernal.nSumSellamount as nSumsellamount From tblFointernal tblFoInternal Where (tblFointernal.nNetquantity > 0 and tblFointernal.cBuysell = 'B' and tblFointernal.nRunningbuytotal <= tblFointernal.nNetquantity + tblFointernal.nBuyquantity) or (tblFointernal.nNetquantity < 0 and tblFointernal.cBuysell = 'S' and abs(tblFointernal.nRunningselltotal) <= Abs(tblFointernal.nNetquantity) + tblFointernal.nBuyquantity) or (tblFointernal.nNetquantity = 0 And tblFointernal.nRunningselltotal = tblFointernal.nSummarysell and tblFointernal.nRunningbuytotal = tblFointernal.nSummarybuy)), tblFinalcost as (Select tblFocost.cClientcode as cClientcode, tblFocost.cScripcode as cScripcode, tblFocost.nStrikeprice as nStrikeprice, tblFocost.cOptiontype as cOptiontype, tblFocost.dExpirydate as dExpirydate, tblFocost.cScripname as cScripname, tblFocost.cOperation as cOperation, tblFocost.cInstrutyp as cInstrutyp, tblFocost.nBaseunit as nBaseunit, tblFocost.cUnitofmeasurement as cUnitofmeasurement, tblFocost.cUnitofTrading as cUnitofTrading, tblFocost.nTradeablelot as nTradeablelot, tblFocost.nPricenumerator as nPricenumerator, tblFocost.nPricedenominator as nPricedenominator, tblFocost.nGeneralnumerator as nGeneralnumerator, tblFocost.nGeneraldenominator as nGeneraldenominator, tblFocost.nSummarybuy - (Case When Sum(tblFocost.nStockquantity) > 0 then Sum(tblFocost.nStockquantity) else 0 end) As nPurchqty, tblFocost.nSumbuyamount - (Case When Sum(tblFocost.nStockquantity) > 0 then Sum(tblFocost.nStockquantity * tblFocost.nBuyNetRate) else 0 end) As nPurchvalue, tblFocost.nSummarysell - (Case When Sum(tblFocost.nStockquantity) < 0 then Sum(Abs(tblFocost.nStockquantity)) else 0 end) as nSalesqty, tblFocost.nSumSellamount - (Case When Sum(tblFocost.nStockquantity) < 0 then Sum(Abs(tblFocost.nStockquantity) * tblFocost.nBuyNetRate) else 0 end) as nSalesvalue, Sum(tblFocost.nStockquantity) As nOsstock, Case When Sum(tblFocost.nStockquantity) != 0 then Round(Sum(tblFocost.nStockquantity * tblFocost.nBuyNetRate) / Sum(tblFocost.nStockquantity), 4) else 0 end as nOsstockavg, Sum(tblFocost.nStockquantity * tblFocost.nBuyNetRate) as nOsstockvalue, tblFocost.nSumSellamount + Sum(tblFocost.nStockquantity * tblFocost.nBuyNetRate) - tblFocost.nSumBuyamount as nProfitLoss, Max(Market.Market) as nMarketrate, Max(Market.Market) * Sum(tblFocost.nStockquantity) as nMarketvalue, ((tblFocost.nSumSellamount + Sum(tblFocost.nStockquantity * tblFocost.nBuyNetRate) - tblFocost.nSumBuyamount)) + ((Max(Market.Market) * Sum(tblFocost.nStockquantity)) - (Sum(tblFocost.nStockquantity * tblFocost.nBuyNetRate))) as nOverallprlo, Max(Market.nPrvcloseprice) as nPrvcloseprice, Max(Market.nHighprice) as nHighprice, Max(Market.nLowprice) as nLowprice, Max(Market.nLowercircuitLimit) as nLowercircuitlimit, Max(Market.nOpenprice) as nOpenprice, Max(Market.nUppercircuitlimit) as nUppercircuitlimit, Max(Market.nNoofTrades) as nNooftrades, Max(Market.nVoltradedToday) as nVoltradedtoday, Max(Market.nVolquantity) as nVolquantity, Max(Market.dLastupdatedate) as dlastupdatedate, Max(Market.n52Weeklow) as n52Weeklow, Max(Market.n52WeekHigh) as n52Weekhigh From tblFocost tblFocost Left Outer Join Market Market On Market.Firmnumber = 'NBS-000001' and tblFocost.cScripcode = Market.Code and tblFocost.nStrikeprice = Market.Strikeprice and tblFocost.cOptiontype = Market.Optiontype and ((Market.nOptmethod = 0 and tblFocost.nStrikeprice = 0) or (Market.nOptmethod = 1 and tblFocost.nStrikeprice != 0)) Group By tblFocost.cClientcode, tblFocost.cScripcode, tblFocost.cScripname, tblFocost.cOperation, tblFocost.cInstrutyp, tblFocost.nBaseunit, tblFocost.cUnitofmeasurement, tblFocost.cUnitofTrading, tblFocost.nTradeablelot, tblFocost.nPricenumerator, tblFocost.nPricedenominator, tblFocost.nGeneralnumerator, tblFocost.nGeneraldenominator, tblFocost.dExpirydate, tblFocost.nStrikeprice, tblFocost.cOptiontype, tblFocost.nSummarybuy, tblFocost.nSumBuyamount, tblFocost.nSummarysell, tblFocost.nSumSellamount), tblPortderfinal as (Select tblFinalcost.cClientcode as cClientcode, tblFinalcost.cScripcode as cScripcode, tblFinalcost.cScripname as cScripname, tblFinalcost.cOperation as cOperation, tblFinalcost.cInstrutyp as cInstrutyp, tblFinalcost.nBaseunit as nBaseunit, tblFinalcost.cUnitofmeasurement as cUnitofmeasurement, tblFinalcost.cUnitofTrading as cUnitofTrading, tblFinalcost.nTradeablelot as nTradeablelot, tblFinalcost.nPricenumerator as nPricenumerator, tblFinalcost.nPricedenominator as nPricedenominator, tblFinalcost.nGeneralnumerator as nGeneralnumerator, tblFinalcost.nGeneraldenominator as nGeneraldenominator, tblFinalcost.nStrikeprice as nStrikeprice, tblFinalcost.cOptiontype as cOptiontype, tblFinalcost.dExpirydate as dExpirydate, tblFinalcost.nPurchqty As nPurchqty, tblFinalcost.nPurchvalue As nPurchvalue, Round(Case When tblFinalcost.nPurchqty != 0 then tblFinalcost.nPurchvalue / tblFinalcost.nPurchqty else 0 End, 4) As nPurchavg, tblFinalcost.nSalesqty as nSalesqty, tblFinalcost.nSalesvalue as nSalesvalue, Round(Case When tblFinalcost.nSalesqty != 0 then tblFinalcost.nSalesvalue / tblFinalcost.nSalesqty else 0 end, 4) as nSalesavg, tblFinalcost.nOsstock As nOsstock, tblFinalcost.nOsstockavg as nOsstockavg, tblFinalcost.nOsstockvalue as nOsstockvalue, tblFinalcost.nMarketrate as nMarketrate, tblFinalcost.nMarketvalue as nMarketvalue, ((tblFinalcost.nMarketrate * tblFinalcost.nOsstock) - (tblFinalcost.nOsstock * tblFinalcost.nOsstockavg)) as nUnrealprlo, tblFinalcost.nProfitloss as nProfitLoss, tblFinalcost.nOverallprlo as nOverallprlo, tblFinalcost.nPrvcloseprice as nPrvcloseprice, tblFinalcost.nHighprice as nHighprice, tblFinalcost.nLowprice as nLowprice, tblFinalcost.nLowercircuitLimit as nLowercircuitlimit, tblFinalcost.nOpenprice as nOpenprice, tblFinalcost.nUppercircuitlimit as nUppercircuitlimit, tblFinalcost.nNooftrades as nNooftrades, tblFinalcost.nVoltradedtoday as nVoltradedtoday, tblFinalcost.nVolquantity as nVolquantity, tblFinalcost.dLastupdatedate as dlastupdatedate, tblFinalcost.n52WeekLow as n52Weeklow, tblFinalcost.n52Weekhigh as n52Weekhigh From tblFinalcost tblFinalcost Order by tblFinalcost.cClientcode, tblFinalcost.cScripname, tblFinalcost.nStrikeprice, tblFinalcost.cOptiontype, tblFinalcost.dExpirydate ), tblPortderfin as (Select tblPortderfinal.cClientcode as cClientcode, '05' as cRowindicator, Sum(tblPortderfinal.nProfitloss) as nFiramount, 0 as nSecamount From tblPortderfinal tblPortderfinal group by tblPortderfinal.cClientcode Union All Select tblPortderfinal.cClientcode as cClientcode, '09' as cRowindicator, Sum(tblPortderfinal.nUnrealprlo) as nFiramount, 0 as nSecamount From tblPortderfinal tblPortderfinal group by tblPortderfinal.cClientcode), tblCashplusderfinal as (Select Coalesce(tblPortcashfin.cClientcode,tblPortderfin.cClientcode) as cClientcode, Case When Coalesce(tblPortcashfin.cRowindicator,tblPortderfin.cRowindicator)='04' or Coalesce(tblPortcashfin.cRowindicator,tblPortderfin.cRowindicator)='05' then '06' else '10' end as cRowindicator, 0 as nFiramount, Sum(Coalesce(tblPortcashfin.nFiramount,tblPortderfin.nFiramount,0)) as nSecamount From tblPortcashfin Full outer join tblPortderfin On tblPortcashfin.cClientcode=tblPortderfin.cClientcode and tblPortcashfin.cRowindicator=tblPortderfin.cRowindicator Where tblPortcashfin.cRowindicator='04' or tblPortcashfin.cRowindicator='08' or tblPortderfin.cRowindicator='05' or tblPortderfin.cRowindicator='09' group by Coalesce(tblPortcashfin.cClientcode,tblPortderfin.cClientcode) , Case When Coalesce(tblPortcashfin.cRowindicator,tblPortderfin.cRowindicator)='04' or Coalesce(tblPortcashfin.cRowindicator,tblPortderfin.cRowindicator)='05' then '06' else '10' end ), tblDividend as (Select Ledger.Oowncode as cClientcode, '11' as cRowindicator, 0 as nFiramount, Sum(Ledger.damount-Ledger.Camount)*-1 as nSecamount From Ledger Ledger Inner Join Journal On Ledger.Firmnumber=Journal.Firmnumber and Ledger.Voucher=Journal.Jvnumber and Ledger.nFinancialyear=Journal.nFinancialyear Where Ledger.Firmnumber='NBS-000001' and Ledger.nFinancialyear=2024 and (Ledger.Oowncode='T5580011') and Ledger.Branchcode='T558' and Ledger.Dtoftran>=to_date('01/04/2023','dd/mm/yyyy') and Ledger.Dtoftran<=to_date('31/03/2024','dd/mm/yyyy') and Journal.nEntrytype=1 group by Ledger.Oowncode ), tblDirectDividend as (Select tblDirectdiv.cClientcode as cClientcode, '16' as cRowindicator, 0 as nFiramount, Sum(tblDirectdiv.nQuantity*tblDirectdiv.nRate)*-1 as nSecamount From tblDirectdiv tblDirectdiv Inner Join Ldfibs Ldfibs On tblDirectdiv.cFirmnumber = Ldfibs.Firmnumber and tblDirectdiv.cClientcode = Ldfibs.Oowncode Where tblDirectdiv.cFirmnumber='NBS-000001' and (tblDirectdiv.cClientcode='T5580011') and tblDirectdiv.dDtoftran>=to_date('01/04/2023','dd/mm/yyyy') and tblDirectdiv.dDtoftran<=to_date('31/03/2024','dd/mm/yyyy') group by tblDirectdiv.cClientcode ), tbltmpBillcharges as (Select Billcharges.Oowncode as cClientcode, Case When Billcharges.Egroup='FU' then '14' else '13' end as cRowindicator, Sum(Billcharges.Quantity*Billcharges.Final_Rat1) as nFiramount, 0 as nSecamount From Billcharges Billcharges Where Billcharges.Firmnumber='NBS-000001' and Billcharges.Brcode='T558' and (Billcharges.Oowncode='T5580011') and Billcharges.Dtoftran>=to_date('01/04/2023','dd/mm/yyyy') and Billcharges.Dtoftran<=to_date('31/03/2024','dd/mm/yyyy') group by Billcharges.Oowncode, Case When Billcharges.Egroup='FU' then '14' else '13' end ), tbltmpbillchgtotal as (Select tbltmpBillcharges.cClientcode as cClientcode, '12' as cRowindicator, 0 as nFiramount, Sum(tbltmpBillcharges.nFiramount) as nSecamount from tbltmpBillcharges tbltmpBillcharges group by tbltmpbillcharges.cClientcode ), tblMiscentries as ( Select Ledger.Oowncode as cClientcode, '15' as cRowindicator, 0 as nFiramount, Sum(Ledger.damount-Ledger.Camount)*-1 as nSecamount From Ledger Ledger Inner Join Journal On Ledger.Firmnumber=Journal.Firmnumber and Ledger.Voucher=Journal.Jvnumber and Ledger.nFinancialyear=Journal.nFinancialyear Where Ledger.Firmnumber='NBS-000001' and Ledger.nFinancialyear=2024 and (Ledger.Oowncode='T5580011') and Ledger.Branchcode='T558' and Ledger.Dtoftran>=to_date('01/04/2023','dd/mm/yyyy') and Ledger.Dtoftran<=to_date('31/03/2024','dd/mm/yyyy') and Journal.nEntrytype!=1 group by Ledger.Oowncode ), tbltempportalloc as (Select Coalesce(tblFinledger.cClientcode,tblPortcashfin.cClientcode) as cClientcode, '27' as cRowindicator, Sum(Nvl(tblFinledger.nFiramount,0)+Nvl(tblPortcashfin.nFiramount,0)) as nFiramount, 0 as nSecamount From tblFinledger tblFinledger Full Outer Join tblPortcashfin On tblFinledger.cClientcode=tblPortcashfin.cClientcode and tblFinledger.cRowindicator=tblPortcashfin.cRowindicator Where (tblFinledger.cRowindicator='26' or tblPortcashfin.cRowindicator='25') group by Coalesce(tblFinledger.cClientcode,tblPortcashfin.cClientcode) ), tbltemptotdays as (Select '18' as cRowindicator, (to_date('31/03/2024','dd/mm/yyyy') - to_date('01/04/2024','dd/mm/yyyy'))+1 as nSecamount From dual ), tblFinalloop as (Select tblReportdesc.cRowindicator as cRowindicator, tblReportdesc.cRowdesc as cRowdesc, Coalesce(tblReportdesc.cClientcode,tblOpenstk.cClientcode,tblCapinout.cClientcode,tblPortcashfin.cClientcode,tblPortderfin.cClientcode,tblCashplusderfinal.cClientcode,tblDividend.cClientcode,tbltmpbillcharges.cClientcode,tbltmpbillchgtotal.cClientcode,tblMiscentries.cClientcode,tblFinledger.cClientcode,tbltempPortalloc.cClientcode,tblDirectdividend.cClientcode) as cClientcode, Coalesce(tblOpenstk.nFiramount,tblCapinout.nFiramount,tblPortcashfin.nFiramount,tblPortderfin.nFiramount,tblCashplusderfinal.nFiramount,tblDividend.nFiramount,tbltmpBillcharges.nFiramount,tbltmpbillchgtotal.nFiramount,tblMiscentries.nFiramount,tblFinledger.nFiramount,tbltempPortalloc.nFiramount,tblDirectdividend.nFiramount) as nFiramount, Coalesce(tblOpenstk.nSecamount,tblCapinout.nSecamount,tblPortcashfin.nSecamount,tblPortderfin.nSecamount,tblCashplusderfinal.nSecamount,tblDividend.nSecamount,tbltmpBillcharges.nSecamount,tbltmpBillchgtotal.nSecamount,tblMiscentries.nSecamount,tblFinledger.nSecamount,tbltempPortalloc.nSecamount,tbltempTotdays.nSecamount,tbltempTotdays.nSecamount) as nSecamount From tblReportdesc tblReportdesc Left Outer Join tblOpenstk On tblReportdesc.cRowindicator=tblOpenstk.cRowindicator and tblReportdesc.cClientcode=tblOpenstk.cClientcode Left Outer Join tblCapinout On tblReportdesc.cRowindicator=tblCapinout.cRowindicator and tblReportdesc.cClientcode=tblCapinout.cClientcode Left Outer Join tblPortcashfin On tblReportdesc.cRowindicator=tblPortcashfin.cRowindicator and tblReportdesc.cClientcode=tblPortcashfin.cClientcode Left Outer Join tblPortderfin On tblReportdesc.cRowindicator=tblPortderfin.cRowindicator and tblReportdesc.cClientcode=tblPortderfin.cClientcode Left Outer Join tblCashplusderfinal On tblReportdesc.cRowindicator=tblCashplusderfinal.cRowindicator and tblReportdesc.cClientcode=tblCashplusderfinal.cClientcode Left Outer Join tblDividend On tblReportdesc.cRowindicator=tblDividend.cRowindicator and tblReportdesc.cClientcode=tblDividend.cClientcode Left Outer Join tbltmpBillcharges On tblReportdesc.cRowindicator=tbltmpBillcharges.cRowindicator and tblReportdesc.cClientcode=tbltmpBillcharges.cClientcode Left Outer Join tbltmpbillchgtotal On tblReportdesc.cRowindicator=tbltmpBillchgtotal.cRowindicator and tblReportdesc.cClientcode=tbltmpBillchgtotal.cClientcode Left Outer Join tblMiscentries On tblReportdesc.cRowindicator=tblMiscentries.cRowindicator and tblReportdesc.cClientcode=tblMiscentries.cClientcode Left Outer Join tblFinledger On tblReportdesc.cRowindicator=tblFinledger.cRowindicator and tblReportdesc.cClientcode=tblFinledger.cClientcode Left Outer Join tbltempPortalloc On tblReportdesc.cRowindicator=tbltempPortalloc.cRowindicator and tblReportdesc.cClientcode=tbltempPortalloc.cClientcode Left Outer Join tblDirectdividend On tblReportdesc.cRowindicator=tblDirectdividend.cRowindicator and tblReportdesc.cClientcode=tblDirectdividend.cClientcode Left Outer Join tbltemptotdays On tblReportdesc.cRowindicator=tbltempTotdays.cRowindicator ), tbltempporttotal as ( Select '17' as cRowindicator, tblFinalloop.cClientcode as cClientcode, Sum(tblFinalloop.nSecamount) as nTotalamount From tblFinalloop Where tblFinalloop.cRowindicator!='18' and nvl(trim(tblFinalloop.cClientcode),' ')!=' ' group by tblFinalloop.cClientcode ), tbltemptotalcapital as ( Select tblFinalloop.cClientcode as cClientcode, Sum(tblFinalloop.nSecamount) as nTotalamount From tblFinalloop tblFinalloop Where (tblFinalloop.cRowindicator='02' or tblFinalloop.cRowindicator='01') and nvl(trim(tblFinalloop.cClientcode),' ')!=' ' group by tblFinalloop.cClientcode ) Select tblFinalloop.cRowindicator as cRowindicator, tblFinalloop.cRowdesc as cRowdesc, tblFinalloop.cClientcode as cClientcode, tblFinalloop.nFiramount as nFiramount, Case When (tblFinalloop.cRowindicator=25 or tblFinalloop.cRowindicator=26) and tbltempPortalloc.nFiramount!=0 then Round(tblFinalloop.nFiramount/tbltempPortalloc.nFiramount*100,2) When tblFInalloop.cRowindicator='17' then tbltempporttotal.nTotalamount When tblFinalloop.cRowindicator='19' and tbltemptotalcapital.nTotalamount!=0 then Round((tbltempporttotal.nTotalamount-tbltemptotalcapital.nTotalamount)*100/tbltemptotalcapital.nTotalamount,2) When tblFinalloop.cRowindicator='20' and tbltemptotalcapital.nTotalamount!=0 then Round(((tbltempporttotal.nTotalamount-tbltemptotalcapital.nTotalamount)*100/tbltemptotalcapital.nTotalamount)*365/ ((to_date('31/03/2024','dd/mm/yyyy') - to_date('01/04/2024','dd/mm/yyyy')+1)),2) else tblFinalloop.nSecamount end as nSecamount From tblFinalloop Left Outer Join tbltempportalloc On tblFinalloop.cClientcode=tbltempportalloc.cClientcode Left Outer Join tbltempporttotal On tblFinalloop.cClientcode=tbltempporttotal.cClientcode Left Outer Join tbltemptotalcapital On tblFinalloop.cClientcode=tbltemptotalcapital.cClientcode Order by 1 Title : 01~Error Description : ORA-01476: divisor is equal to zero Method : getglobalportfolioLine : 44015 Message : getGlobalportfolio StackTrace : at OracleInternal.ServiceObjects.OracleConnectionImpl.VerifyExecution(Int32& cursorId, Boolean bThrowArrayBindRelatedErrors, SqlStatementType sqlStatementType, Int32 arrayBindCount, OracleException& exceptionForArrayBindDML, Boolean& hasMoreRowsInDB, Boolean bFirstIterationDone) at OracleInternal.ServiceObjects.OracleCommandImpl.ExecuteReader(String commandText, OracleParameterCollection paramColl, CommandType commandType, OracleConnectionImpl connectionImpl, OracleDataReaderImpl& rdrImpl, Int32 longFetchSize, Int64 clientInitialLOBFS, OracleDependencyImpl orclDependencyImpl, Int64[] scnForExecution, Int64[]& scnFromExecution, OracleParameterCollection& bindByPositionParamColl, Boolean& bBindParamPresent, Int64& internalInitialLOBFS, OracleException& exceptionForArrayBindDML, OracleConnection connection, OracleLogicalTransaction& oracleLogicalTransaction, IEnumerable`1 adrianParsedStmt, Boolean isDescribeOnly, Boolean isFromEF) at Oracle.ManagedDataAccess.Client.OracleCommand.ExecuteReader(Boolean requery, Boolean fillRequest, CommandBehavior behavior) at Oracle.ManagedDataAccess.Client.OracleDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable) at clientlevel.Thinclientlevel.Clientlogin.getglobalportfolio(DateTime tdStartdate, DateTime tdEnddate, DateTime tdPoadate, DateTime tdFinancialstartdate, Int32 tnAngleselection, String tcClientfilter, Cliole loLdcommon) in File25:line 44015 Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 847355904 Shut down : N Username : MOBBO Date/Time : 17/05/2024 9:08:20 PM Connection : Closed =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : T5580011 With tbltempReport as (Select '01' as cRowindicator, 'Opening Market Value' as cRowdesc From Dual Union All Select '02' as cRowindicator, 'Capital In(+)/Out(-)' as cRowdesc From Dual Union All Select '03' as cRowindicator, Rpad(' ',8)||'Realized Profit (+)/(-)' as cRowdesc From dual Union All Select '04' as cRowindicator, 'Cash Segment' as cRowdesc From dual Union All Select '05' as cRowindicator, 'Derivatives Segment' as cRowdesc From dual Union All Select '06' as cRowindicator, 'Total Realized Profit(+)/(-) ' as cRowdesc From dual Union All Select '07' as cRowindicator, Rpad(' ',8)||'Un-Realized Profit (+)/(-) ' as cRowdesc From dual Union All Select '08' as cRowindicator, 'Cash Segment' as cRowdesc From dual Union All Select '09' as cRowindicator, 'Derivatives Segment' as cRowdesc From dual Union All Select '10' as cRowindicator, 'Total Un-Realized Profit(+)/(-) ' as cRowdesc From dual Union All Select '11' as cRowindicator, 'Total Dividend Amount' as cRowdesc From dual Union All Select '12' as cRowindicator, Rpad(' ',8)||'Statutory Charges' as cRowdesc From dual Union All Select '13' as cRowindicator, 'Cash Segment' as cRowdesc From dual Union All Select '14' as cRowindicator, 'Derivatives Segment' as cRowdesc From dual Union All Select '15' as cRowindicator, 'Misc. JV Entries' as cRowdesc From dual Union All Select '16' as cRowindicator, 'Direct Dividend Credit' as cRowdesc From dual Union All Select '17' as cRowindicator, 'Total Portfolio Allocation' as cRowdesc From dual Union All Select '18' as cRowindicator, 'Total No. of Days' as cRowdesc From dual Union All Select '19' as cRowindicator, 'Absolute Return' as cRowdesc From dual Union All Select '20' as cRowindicator, 'Annualized Return' as cRowdesc From dual Union All Select '24' as cRowindicator, Rpad(' ',8)||'Portfolio Allocation' as cRowdesc From dual Union All Select '25' as cRowindicator, 'Equity' as cRowdesc From dual Union All Select '26' as cRowindicator, 'Cash and Equivalent' as cRowdesc From dual Union All Select '27' as cRowindicator, 'Total Portfolio Allocation' as cRowdesc From dual ), tblReportdesc as (Select Ldfibs.Oowncode as cClientcode, tbltempReport.* From Ldfibs Ldfibs Left Outer Join tbltempReport On 1=1 Where Ldfibs.Firmnumber='NBS-000001' and (Ldfibs.Oowncode='T5580011') and Ldfibs.Brcode='T558' ), tblOpendet as (Select Ledger.Oowncode as cClientcode, '01' as cRowindicator, Sum(Ledger.Damount-Ledger.Camount)*-1 as nSecamount From Ledger Ledger Where Ledger.Firmnumber='NBS-000001' and Ledger.nFinancialyear=2024 and (Ledger.Oowncode='T5580011') and Ledger.Branchcode='T558' and Substr(Ledger.Voucher,1,4)='OPNG' group by Ledger.Oowncode Union All Select Sauda.Oowncode as cClientcode, '01' as cRowindicator, Sum(Sauda.Quantity*Sauda.Market) as nSecamount From Sauda Sauda Where Sauda.Egroup='OK' and Sauda.Firmnumber = 'NBS-000001' and (Sauda.Oowncode='T5580011') and Sauda.Brcode='T558' group by Sauda.Oowncode ), tblOpenstk as (Select tblOpendet.cClientcode as cClientcode, Max(tblOpendet.cRowindicator) as cRowindicator, 0 as nFiramount, Sum(tblOpendet.nSecamount) as nSecamount From tblOpendet tblOpendet group by tblOpendet.cClientcode), tblCapinout as (Select Ledger.Oowncode as cClientcode, '02' as cRowindicator, 0 as nFiramount, Sum(Ledger.Damount-Ledger.Camount)*-1 as nSecamount From Ledger Ledger Where Ledger.Firmnumber='NBS-000001' and Ledger.nFinancialyear=2024 and (Ledger.Oowncode='T5580011') and Ledger.Branchcode='T558' and Ledger.Dtoftran>=to_date('01/04/2023','dd/mm/yyyy') and Ledger.Dtoftran<=to_date('31/03/2024','dd/mm/yyyy') and (Substr(Ledger.Voucher,1,2)='RE' or Substr(Ledger.Voucher,1,2)='PY') group by Ledger.Oowncode ), tblFinledger as (Select Ledger.Oowncode as cClientcode, '26' as cRowindicator, Sum(Ledger.Damount-Ledger.Camount)*-1 as nFiramount, 0 as nSecamount From Ledger Ledger Where Ledger.Firmnumber='NBS-000001' and Ledger.nFinancialyear=2024 and (Ledger.Oowncode='T5580011') and Ledger.Branchcode='T558' and Ledger.Dtoftran>=to_date('01/04/2023','dd/mm/yyyy') and Ledger.Dtoftran<=to_date('31/03/2024','dd/mm/yyyy') group by Ledger.Oowncode ), tblCashinternal as (Select Sauda.Oowncode as cClientcode, Sauda.Compcode as cScripcode, Sauda.Dtoftran as dBuydate, Sauda.BuySell as cBuysell, Sum(Sauda.Quantity) as nBuyquantity, Case When Sum(Sauda.Brokpercontract) = 0 Then Avg(Sauda.Final_Rat1) Else Case When Sauda.BuySell = 'B' Then Round(((Sum(Sauda.Quantity) * Avg(Sauda.Final_Rat1)) + Sum(Sauda.Brokpercontract)) / Sum(Sauda.Quantity), 10) Else Round(((Sum(Sauda.Quantity) * Avg(Sauda.Final_Rat1)) - Sum(Sauda.Brokpercontract)) / Sum(Sauda.Quantity), 10) End End as nBuynetrate, Sum(Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, Sauda.Quantity * -1))) Over(Partition By Sauda.Oowncode, Sauda.Compcode Order By Sauda.Dtoftran, Sauda.Final_Rat1 rows between current row and unbounded following) as nRunningqty, Sum(Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, 0))) Over(Partition By Sauda.Oowncode, Sauda.Compcode Order By Sauda.Dtoftran, Sauda.Final_Rat1 rows between current row and unbounded following) as nRunningbuytotal, Sum(Sum(Decode(Sauda.Buysell, 'S', Sauda.Quantity, 0))) Over(Partition By Sauda.Oowncode, Sauda.Compcode Order By Sauda.Dtoftran, Sauda.Final_Rat1 rows between current row and unbounded following) as nRunningselltotal, Sum(Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, 0))) Over(Partition By Sauda.Oowncode, Sauda.Compcode) as nSummarybuy, Sum(Sum(Decode(Sauda.Buysell, 'S', Sauda.Quantity, 0))) Over(Partition By Sauda.Oowncode, Sauda.Compcode) as nSummarysell, Sum(Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, 0)) * Case When Sum(Sauda.Brokpercontract) = 0 Then Avg(Sauda.Final_Rat1) Else Case When Sauda.BuySell = 'B' Then Round(((Sum(Sauda.Quantity) * Avg(Sauda.Final_Rat1)) + Sum(Sauda.Brokpercontract)) / Sum(Sauda.Quantity), 10) Else 0 End End) Over(Partition By Sauda.Oowncode, Sauda.Compcode) as nSumBuyamount, Sum(Sum(Decode(Sauda.Buysell, 'S', Sauda.Quantity, 0)) * Case When Sum(Sauda.Brokpercontract) = 0 Then Avg(Sauda.Final_Rat1) Else Case When Sauda.BuySell = 'B' Then 0 Else Round(((Sum(Sauda.Quantity) * Avg(Sauda.Final_Rat1)) - Sum(Sauda.Brokpercontract)) / Sum(Sauda.Quantity), 10) End End) Over(Partition By Sauda.Oowncode, Sauda.Compcode) as nSumSellamount, Sum(Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, Sauda.Quantity * -1))) Over(Partition By Sauda.Oowncode, Sauda.Compcode) As nNetquantity From Sauda Sauda Where Sauda.Firmnumber='NBS-000001' and Sauda.Egroup!='YC' and Sauda.Egroup != 'LB' and Sauda.Egroup != 'SR' and Sauda.Egroup != 'LA' and Sauda.Sterminal != '99999' and Sauda.Dtoftran 0 Then Case When tblCashinternal.nRunningbuytotal > tblCashinternal.nNetquantity Then tblCashinternal.nNetquantity + tblCashinternal.nBuyquantity - tblCashinternal.nRunningbuytotal Else tblCashinternal.nBuyquantity End When tblCashinternal.nNetquantity < 0 Then Case When Abs(tblCashinternal.nRunningselltotal) > Abs(tblCashinternal.nNetquantity) Then tblCashinternal.nNetquantity - tblCashinternal.nBuyquantity + tblCashinternal.nRunningselltotal Else tblCashinternal.nBuyquantity * -1 End End) as nOpStockquantity, Sum((Case When tblCashinternal.nNetquantity = 0 Then 0 When tblCashinternal.nNetquantity > 0 Then Case When tblCashinternal.nRunningbuytotal > tblCashinternal.nNetquantity Then tblCashinternal.nNetquantity + tblCashinternal.nBuyquantity - tblCashinternal.nRunningbuytotal Else tblCashinternal.nBuyquantity End When tblCashinternal.nNetquantity < 0 Then Case When Abs(tblCashinternal.nRunningselltotal) > Abs(tblCashinternal.nNetquantity) Then tblCashinternal.nNetquantity - tblCashinternal.nBuyquantity + tblCashinternal.nRunningselltotal Else tblCashinternal.nBuyquantity * -1 End End) * tblCashinternal.nBuynetrate) as nOpStockAmount from tblCashinternal Where (tblCashinternal.nNetquantity > 0 And tblCashinternal.cBuysell = 'B' And tblCashinternal.nRunningbuytotal <= tblCashinternal.nNetquantity + tblCashinternal.nBuyquantity) or (tblCashinternal.nNetquantity < 0 and tblCashinternal.cBuysell = 'S' and Abs(tblCashinternal.nRunningselltotal) <= Abs(tblCashinternal.nNetquantity) + tblCashinternal.nBuyquantity) Group By tblCashinternal.cClientcode, tblCashinternal.cScripcode), tblCashinternal1 as (Select Sauda.Oowncode as cClientcode, Sauda.Compcode as cScripcode, Sauda.Dtoftran as dBuydate, Sauda.BuySell as cBuysell, Sum(Sauda.Quantity) as nBuyquantity, Case When Sum(Sauda.Brokpercontract) = 0 Then Avg(Sauda.Final_Rat1) Else Case When Sauda.BuySell = 'B' Then Round(((Sum(Sauda.Quantity) * Avg(Sauda.Final_Rat1)) + Sum(Sauda.Brokpercontract)) / Sum(Sauda.Quantity), 10) Else Round(((Sum(Sauda.Quantity) * Avg(Sauda.Final_Rat1)) - Sum(Sauda.Brokpercontract)) / Sum(Sauda.Quantity), 10) End End as nBuynetrate, Sum(Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, Sauda.Quantity * -1))) Over(Partition By Sauda.Oowncode, Sauda.Compcode Order By Sauda.Dtoftran, Sauda.Final_Rat1 rows between current row and unbounded following) as nRunningqty, Sum(Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, 0))) Over(Partition By Sauda.Oowncode, Sauda.Compcode Order By Sauda.Dtoftran, Sauda.Final_Rat1 rows between current row and unbounded following) as nRunningbuytotal, Sum(Sum(Decode(Sauda.Buysell, 'S', Sauda.Quantity, 0))) Over(Partition By Sauda.Oowncode, Sauda.Compcode Order By Sauda.Dtoftran, Sauda.Final_Rat1 rows between current row and unbounded following) as nRunningselltotal, Sum(Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, 0))) Over(Partition By Sauda.Oowncode, Sauda.Compcode) as nSummarybuy, Sum(Sum(Decode(Sauda.Buysell, 'S', Sauda.Quantity, 0))) Over(Partition By Sauda.Oowncode, Sauda.Compcode) as nSummarysell, Sum(Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, 0)) * Case When Sum(Sauda.Brokpercontract) = 0 Then Avg(Sauda.Final_Rat1) Else Case When Sauda.BuySell = 'B' Then Round(((Sum(Sauda.Quantity) * Avg(Sauda.Final_Rat1)) + Sum(Sauda.Brokpercontract)) / Sum(Sauda.Quantity), 10) Else 0 End End) Over(Partition By Sauda.Oowncode, Sauda.Compcode) as nSumBuyamount, Sum(Sum(Decode(Sauda.Buysell, 'S', Sauda.Quantity, 0)) * Case When Sum(Sauda.Brokpercontract) = 0 Then Avg(Sauda.Final_Rat1) Else Case When Sauda.BuySell = 'B' Then 0 Else Round(((Sum(Sauda.Quantity) * Avg(Sauda.Final_Rat1)) - Sum(Sauda.Brokpercontract)) / Sum(Sauda.Quantity), 10) End End) Over(Partition By Sauda.Oowncode, Sauda.Compcode) as nSumSellamount, Sum(Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, Sauda.Quantity * -1))) Over(Partition By Sauda.Oowncode, Sauda.Compcode) As nNetquantity From Sauda Sauda Where Sauda.Firmnumber='NBS-000001' and Sauda.Egroup!='YC' and Sauda.Egroup != 'LB' and Sauda.Egroup != 'SR' and Sauda.Egroup != 'LA' and Sauda.Sterminal != '99999' and Sauda.Dtoftran<=to_date('31/03/2024','dd/mm/yyyy') and Sauda.Brcode='T558' and (Sauda.Oowncode='T5580011') group by Sauda.Oowncode, Sauda.Dtoftran, Sauda.Final_Rat1, Sauda.buysell, Sauda.Compcode), tblClosing as (Select tblCashinternal1.cClientcode as cClientcode, tblCashinternal1.cScripcode as cScripcode, Sum(Case When tblCashinternal1.nNetquantity = 0 Then 0 When tblCashinternal1.nNetquantity > 0 Then Case When tblCashinternal1.nRunningbuytotal > tblCashinternal1.nNetquantity Then tblCashinternal1.nNetquantity + tblCashinternal1.nBuyquantity - tblCashinternal1.nRunningbuytotal Else tblCashinternal1.nBuyquantity End When tblCashinternal1.nNetquantity < 0 Then Case When Abs(tblCashinternal1.nRunningselltotal) > Abs(tblCashinternal1.nNetquantity) Then tblCashinternal1.nNetquantity - tblCashinternal1.nBuyquantity + tblCashinternal1.nRunningselltotal Else tblCashinternal1.nBuyquantity * -1 End End) AS nCLStockquantity, Sum((Case When tblCashinternal1.nNetquantity = 0 Then 0 When tblCashinternal1.nNetquantity > 0 Then Case When tblCashinternal1.nRunningbuytotal > tblCashinternal1.nNetquantity Then tblCashinternal1.nNetquantity + tblCashinternal1.nBuyquantity - tblCashinternal1.nRunningbuytotal Else tblCashinternal1.nBuyquantity End When tblCashinternal1.nNetquantity < 0 Then Case When Abs(tblCashinternal1.nRunningselltotal) > Abs(tblCashinternal1.nNetquantity) Then tblCashinternal1.nNetquantity - tblCashinternal1.nBuyquantity + tblCashinternal1.nRunningselltotal Else tblCashinternal1.nBuyquantity * -1 End End) * tblCashinternal1.nBuynetrate) as nClStockAmount from tblCashinternal1 Where (tblCashinternal1.nNetquantity > 0 And tblCashinternal1.cBuysell = 'B' And tblCashinternal1.nRunningbuytotal <= tblCashinternal1.nNetquantity + tblCashinternal1.nBuyquantity) or (tblCashinternal1.nNetquantity < 0 and tblCashinternal1.cBuysell = 'S' and Abs(tblCashinternal1.nRunningselltotal) <= Abs(tblCashinternal1.nNetquantity) + tblCashinternal1.nBuyquantity) Group By tblCashinternal1.cClientcode, tblCashinternal1.cScripcode), tblBuYSell as (Select Sauda.Oowncode as cClientcode, Sauda.Compcode as cScripcode, Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, 0)) as nbuyQty, Sum(Decode(Sauda.Buysell, 'S', Sauda.Quantity, 0)) as nsellQty, Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity * Sauda.Final_Rat1 , 0)+Case When Sauda.Buysell='B' then Sauda.Brokpercontract else 0 end) as nBuyamount, Sum(Decode(Sauda.Buysell, 'S', Sauda.Quantity * Sauda.Final_Rat1 , 0)-Case When Sauda.Buysell='S' then Sauda.Brokpercontract else 0 end) as nSellamount From Sauda Sauda Where Sauda.Firmnumber='NBS-000001' and Sauda.Egroup!='YC' and Sauda.Egroup != 'LB' and Sauda.Egroup != 'SR' and Sauda.Egroup != 'LA' and Sauda.Sterminal != '99999' and Sauda.Dtoftran>=to_date('01/04/2023','dd/mm/yyyy') and Sauda.Dtoftran<=to_Date('31/03/2024','dd/mm/yyyy') and Sauda.Brcode='T558' and (Sauda.Oowncode='T5580011') group by Sauda.Oowncode, Sauda.Compcode), tblCashcost as (Select Coalesce(tblOpening.cClientcode,tblClosing.cClientcode,tblBuysell.cClientcode) as cClientcode, Coalesce(tblOpening.cScripcode,tblClosing.cScripcode,tblBuysell.cScripcode) as cScripcode, Nvl(tblOpening.nOpstockquantity,0) as nOpstockquantity, Nvl(tblOpening.nOpstockamount,0) as nOpstockamount, Case When Nvl(tblOpening.nOpstockquantity,0)!=0 then Round(Nvl(tblOpening.nOpstockamount,0)/Nvl(tblOpening.nOpstockquantity,0),4) else 0 end as nOpstockavg, Nvl(tblBuysell.nBuyqty,0) as nPrePurchqty, Nvl(tblBuysell.nBuyamount,0) as nPrePurchvalue, Case When Nvl(tblBuysell.nBuyqty,0) !=0 then Round(Nvl(tblBuysell.nBuyamount,0)/Nvl(tblBuysell.nBuyqty,0),4) else 0 end as nPrePurchavg, Nvl(tblBuysell.nSellQty, 0) as nPreSellqty, Nvl(tblBuysell.nSellamount, 0) as nPreSellvalue, Case When Nvl(tblBuysell.nSellQty, 0) != 0 then Round(Nvl(tblBuysell.nSellamount, 0) / Nvl(tblBuysell.nSellQty, 0), 4) else 0 end as nPreSellavg, Least((Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockquantity, 0) + Nvl(tblBuysell.nBuyqty, 0) Else Nvl(tblBuysell.nBuyqty, 0) End), (Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockquantity, 0)) + Nvl(tblBuysell.nSellqty, 0) Else Nvl(tblBuysell.nSellqty, 0) End)) as nPurchqty, Round((Case When (Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockquantity, 0) + Nvl(tblBuysell.nBuyqty, 0) Else Nvl(tblBuysell.nBuyqty, 0) End) <= (Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockquantity, 0)) + Nvl(tblBuysell.nSellqty, 0) Else Nvl(tblBuysell.nSellqty, 0) End) Then Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockAmount, 0) + Nvl(tblBuysell.nBuyAmount, 0) Else Nvl(tblBuysell.nBuyAmount, 0) End Else Nvl(tblBuysell.nBuyAmount, 0) + Nvl(tblOpening.nOpstockAmount, 0) - nvl(tblClosing.nClStockAmount, 0) End), 2) as nPurchvalue, Round((Case When Least((Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockquantity, 0) + Nvl(tblBuysell.nBuyqty, 0) Else Nvl(tblBuysell.nBuyqty, 0) End), (Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockquantity, 0)) + Nvl(tblBuysell.nSellqty, 0) Else Nvl(tblBuysell.nSellqty, 0) End)) != 0 Then (Case When (Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockquantity, 0) + Nvl(tblBuysell.nBuyqty, 0) Else Nvl(tblBuysell.nBuyqty, 0) End) <= (Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockquantity, 0)) + Nvl(tblBuysell.nSellqty, 0) Else Nvl(tblBuysell.nSellqty, 0) End) Then Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockAmount, 0) + Nvl(tblBuysell.nBuyAmount, 0) Else Nvl(tblBuysell.nBuyAmount, 0) End Else Nvl(tblBuysell.nBuyAmount, 0) + Nvl(tblOpening.nOpstockAmount, 0) - nvl(tblClosing.nClStockAmount, 0) End) / (Least((Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockquantity, 0) + Nvl(tblBuysell.nBuyqty, 0) Else Nvl(tblBuysell.nBuyqty, 0) End), (Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockquantity, 0)) + Nvl(tblBuysell.nSellqty, 0) Else Nvl(tblBuysell.nSellqty, 0) End))) Else 0 End), 4) as nPurchavg, Least((Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockquantity, 0) + Nvl(tblBuysell.nBuyqty, 0) Else Nvl(tblBuysell.nBuyqty, 0) End), (Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockquantity, 0)) + Nvl(tblBuysell.nSellqty, 0) Else Nvl(tblBuysell.nSellqty, 0) End)) as nSalesqty, Round((Case When (Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockquantity, 0) + Nvl(tblBuysell.nBuyqty, 0) Else Nvl(tblBuysell.nBuyqty, 0) End) >= (Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockquantity, 0)) + Nvl(tblBuysell.nSellqty, 0) Else Nvl(tblBuysell.nSellqty, 0) End) Then Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockAmount, 0)) + Nvl(tblBuysell.nSellAmount, 0) Else Nvl(tblBuysell.nSellAmount, 0) End Else Nvl(tblBuysell.nSellAmount, 0) - Nvl(tblOpening.nOpstockAmount, 0) + nvl(tblClosing.nClStockAmount, 0) End), 2) as nSalesvalue, Round((Case When Least((Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockquantity, 0) + Nvl(tblBuysell.nBuyqty, 0) Else Nvl(tblBuysell.nBuyqty, 0) End), (Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockquantity, 0)) + Nvl(tblBuysell.nSellqty, 0) Else Nvl(tblBuysell.nSellqty, 0) End)) != 0 Then (Case When (Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockquantity, 0) + Nvl(tblBuysell.nBuyqty, 0) Else Nvl(tblBuysell.nBuyqty, 0) End) >= (Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockquantity, 0)) + Nvl(tblBuysell.nSellqty, 0) Else Nvl(tblBuysell.nSellqty, 0) End) Then Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockAmount, 0)) + Nvl(tblBuysell.nSellAmount, 0) Else Nvl(tblBuysell.nSellAmount, 0) End Else Nvl(tblBuysell.nSellAmount, 0) - Nvl(tblOpening.nOpstockAmount, 0) + nvl(tblClosing.nClStockAmount, 0) End) / (Least((Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockquantity, 0) + Nvl(tblBuysell.nBuyqty, 0) Else Nvl(tblBuysell.nBuyqty, 0) End), (Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockquantity, 0)) + Nvl(tblBuysell.nSellqty, 0) Else Nvl(tblBuysell.nSellqty, 0) End))) ELse 0 End), 4) as nSalesavg, Nvl(tblClosing.nClstockquantity, 0) as nOsstock, Nvl(tblClosing.nClstockamount, 0) as nOsstockvalue, Case When Nvl(tblClosing.nClstockquantity, 0) != 0 then Round(Nvl(tblClosing.nClstockamount, 0) / Nvl(tblClosing.nClstockquantity, 0), 4) else 0 end as nOsstockavg, (nvl(tblBuySell.nSellAmount, 0) - nvl(tblOpening.nOpStockAmount, 0) - nvl(tblBuySell.nBuyAmount, 0) + nvl(tblClosing.nClStockAmount, 0)) as nProfitloss, ((Market.Market * nvl(tblClosing.nClstockquantity, 0)) - Nvl(tblClosing.nClstockamount, 0)) As nUnrealprlo, (nvl(tblBuySell.nSellAmount, 0) - nvl(tblOpening.nOpStockAmount, 0) - nvl(tblBuySell.nBuyAmount, 0) + nvl(tblClosing.nClStockAmount, 0)) + ((Market.Market * nvl(tblClosing.nClstockquantity, 0)) - Nvl(tblClosing.nClstockamount, 0)) As nOverallprlo, Market.Market as nMarketrate, Market.Market*Nvl(tblClosing.nClstockquantity,0) As nMarketvalue from tblOPening tblOpening Full Join TblClosing on tblOpening.cclientcode = tblclosing.cclientcode and tblOPening.cScripcode = tblClosing.cScripcode Full Join TblBuySell on tblBuySell.cclientcode = coalesce(tblOpening.cclientcode, tblclosing.cclientcode) and tblBuySell.cScripcode = coalesce(tblOPening.cScripcode, tblClosing.cScripcode) Left Outer Join Market Market On Market.Firmnumber='NBS-000001' and Market.code=coalesce(tblOpening.cScripcode, tblclosing.cScripcode, tblBuysell.cScripcode) ), tblOpendet as (Select Ledger.Oowncode as cClientcode, '01' as cRowindicator, Sum(Ledger.Damount-Ledger.Camount)*-1 as nSecamount From Ledger Ledger Where Ledger.Firmnumber='NBS-000001' and Ledger.nFinancialyear = 2024 and (Ledger.Oowncode='T5580011') and Ledger.Branchcode='T558' and Substr(Ledger.Voucher,1,4)='OPNG' group by Ledger.Oowncode Union All Select tblCashcost.cClientcode as cClientcode, '01' as cRowindicator, Sum(tblCashcost.nOpstockamount) as nSecamount From tblCashcost tblCashcost group by tblCashcost.cClientcode ), tblOpenstk as (Select tblOpendet.cClientcode as cClientcode, Max(tblOpendet.cRowindicator) as cRowindicator, 0 as nFiramount, Sum(tblOpendet.nSecamount) as nSecamount From tblOpendet tblOpendet group by tblOpendet.cClientcode), tblPortcashfin as (Select tblCashcost.cClientcode as cClientcode, '04' as cRowindicator, Sum(tblCashcost.nProfitloss) as nFiramount, 0 as nSecamount From tblCashcost tblCashcost group by tblCashcost.cClientcode Union All Select tblCashcost.cClientcode as cClientcode, '25' as cRowindicator, Sum(tblCashcost.nMarketvalue) as nFiramount, 0 as nSecamount From tblCashcost tblCashcost group by tblCashcost.cClientcode Union All Select tblCashcost.cClientcode as cClientcode, '08' as cRowindicator, Sum(tblCashcost.nUnrealprlo) as nFiramount, 0 as nSecamount From tblCashcost tblCashcost group by tblCashcost.cClientcode ), tblFointernal as (Select Fosauda.Oowncode as cClientcode, Fosauda.Compcode as cScripcode, Fosauda.Strikeprice as nStrikeprice, Fosauda.Optiontype as cOptiontype, Company.Fibsacct as cScripname, Company.Expirydate as dExpirydate, Exchange.Operation as cOperation, Company.Instrutyp as cInstrutyp, Company.nBaseunit as nBaseunit, Company.cUnitofmeasurement as cUnitofmeasurement, Company.cUnitofTrading as cUnitofTrading, Company.nTradeablelot as nTradeablelot, Company.nPricenumerator as nPricenumerator, Company.nPricedenominator as nPricedenominator, Company.nGeneralnumerator as nGeneralnumerator, Company.nGeneraldenominator as nGeneraldenominator, Fosauda.Dtoftran as dBuydate, Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') or Fosauda.Optiontype != 'PO' Then Fosauda.Buysell else Case When Fosauda.Buysell = 'B' Then 'S' Else 'B' End end as cBuysell, Sum(Fosauda.quantity) as nBuyquantity, Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') Then Case When Sum(Fosauda.nValuebrokerage) = 0 then Avg(Fosauda.Final_Rat1) else Case When Fosauda.BuySell = 'B' Then Round(((Sum(Fosauda.Quantity) * Avg(Fosauda.Final_Rat1)) + Sum(Fosauda.nValuebrokerage)) / Sum(Fosauda.Quantity), 10) Else Round(((Sum(Fosauda.Quantity) * Avg(Fosauda.Final_Rat1)) - Sum(Fosauda.nValuebrokerage)) / Sum(Fosauda.Quantity), 10) End End Else Case When Fosauda.Buysell = 'B' Then Avg(Fosauda.Final_rat1) - Avg(Fosauda.Strikeprice) else Avg(Fosauda.Strikeprice) - Avg(Fosauda.Final_rat1) End End as nBuynetrate, Sum(Sum(Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') or Fosauda.Optiontype != 'PO' Then Decode(Fosauda.Buysell, 'B', Fosauda.Quantity, Fosauda.Quantity * -1) Else Decode(Fosauda.Buysell, 'S', Fosauda.Quantity, Fosauda.Quantity * -1) End)) Over(Partition By Fosauda.Oowncode, Company.Fibsacct, Fosauda.Strikeprice, Fosauda.Optiontype Order By Fosauda.Dtoftran, Fosauda.Final_Rat1 rows between current row and unbounded following) as nRunningqty, Sum(Sum(Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') or Fosauda.optiontype != 'PO' Then Decode(Fosauda.Buysell, 'B', Fosauda.Quantity, 0) Else Decode(Fosauda.Buysell, 'S', Fosauda.Quantity, 0) End)) Over(Partition By Fosauda.Oowncode, Company.Fibsacct, Fosauda.Strikeprice, Fosauda.Optiontype Order By Fosauda.Dtoftran, Fosauda.Final_Rat1 rows between current row and unbounded following) as nRunningbuytotal, Sum(Sum(Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') or Fosauda.Optiontype != 'PO' Then Decode(Fosauda.Buysell, 'S', Fosauda.Quantity, 0) Else Decode(Fosauda.Buysell, 'B', Fosauda.Quantity, 0) End)) Over(Partition By Fosauda.Oowncode, Company.Fibsacct, Fosauda.Strikeprice, Fosauda.Optiontype Order By Fosauda.Dtoftran, Fosauda.Final_Rat1 rows between current row and unbounded following) as nRunningselltotal, Sum(Sum(Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') or Fosauda.optiontype != 'PO' Then Decode(Fosauda.Buysell, 'B', Fosauda.Quantity, 0) Else Decode(Fosauda.Buysell, 'S', Fosauda.Quantity, 0) End)) Over(Partition By Fosauda.Oowncode, Company.Fibsacct, Fosauda.Strikeprice, Fosauda.Optiontype) as nSummarybuy, Sum(Sum(Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') or Fosauda.optiontype != 'PO' Then Decode(Fosauda.Buysell, 'S', Fosauda.Quantity, 0) Else Decode(Fosauda.Buysell, 'B', Fosauda.Quantity, 0) End)) Over(Partition By Fosauda.Oowncode, Company.Fibsacct, Fosauda.Strikeprice, Fosauda.Optiontype) as nSummarysell, Sum(Sum(Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') or Fosauda.Optiontype != 'PO' Then Decode(Fosauda.Buysell, 'B', Fosauda.Quantity, 0) Else Decode(Fosauda.Buysell, 'S', Fosauda.Quantity, 0) End) * Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') Then Case When Sum(Fosauda.nValuebrokerage) = 0 then Avg(Fosauda.Final_Rat1) else Case When Fosauda.BuySell = 'B' Then Round(((Sum(Fosauda.Quantity) * Avg(Fosauda.Final_Rat1)) + Sum(Fosauda.nValuebrokerage)) / Sum(Fosauda.Quantity), 10) Else Round(((Sum(Fosauda.Quantity) * Avg(Fosauda.Final_Rat1)) - Sum(Fosauda.nValuebrokerage)) / Sum(Fosauda.Quantity), 10) End End Else Abs(Avg(Fosauda.Final_Rat1) - Avg(fosauda.strikeprice)) End) Over(Partition By Fosauda.Oowncode, Company.Fibsacct, Fosauda.Strikeprice, Fosauda.Optiontype) as nSumBuyamount, Sum(Sum(Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') or Fosauda.Optiontype != 'PO' Then Decode(Fosauda.Buysell, 'S', Fosauda.Quantity, 0) Else Decode(Fosauda.Buysell, 'B', Fosauda.Quantity, 0) End) * Case When (Fosauda.saudatype != 'AS' and Fosauda.Saudatype != 'EX') Then Case When Sum(Fosauda.nValuebrokerage) = 0 then Avg(Fosauda.Final_Rat1) else Case When Fosauda.BuySell = 'B' Then Round(((Sum(Fosauda.Quantity) * Avg(Fosauda.Final_Rat1)) + Sum(Fosauda.nValuebrokerage)) / Sum(Fosauda.Quantity), 10) Else Round(((Sum(Fosauda.Quantity) * Avg(Fosauda.Final_Rat1)) - Sum(Fosauda.nValuebrokerage)) / Sum(Fosauda.Quantity), 10) End End Else Abs(Avg(Fosauda.Final_Rat1) - Avg(fosauda.strikeprice)) End) Over(Partition By Fosauda.Oowncode, Company.Fibsacct, Fosauda.Strikeprice, Fosauda.Optiontype) as nSumSellamount, Sum(Sum(Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') or Fosauda.optiontype != 'PO' Then Decode(Fosauda.Buysell, 'B', Fosauda.Quantity, Fosauda.Quantity * -1) Else Decode(Fosauda.Buysell, 'S', Fosauda.Quantity, Fosauda.Quantity * -1) End)) Over(Partition By Fosauda.Oowncode, Company.Fibsacct, Fosauda.Strikeprice, Fosauda.Optiontype) As nNetquantity From Fosauda Fosauda Inner Join Company Company On Fosauda.firmnumber = Company.Firmnumber and Fosauda.Compcode = Company.oowncode Inner Join Exchange Exchange On Fosauda.Firmnumber = Exchange.Firmnumber and Fosauda.Exchcode = Exchange.Code Where Fosauda.Firmnumber = 'NBS-000001' and Fosauda.Egroup != 'YF' and Fosauda.Egroup != 'LB' and Fosauda.Egroup != 'SR' and Fosauda.Egroup != 'LA' and Fosauda.Sterminal != '99999' and (Fosauda.Oowncode='T5580011') and Fosauda.Brcode='T558' and Fosauda.Dtoftran>=to_date('01/04/2023','dd/mm/yyyy') and Fosauda.Dtoftran<=to_date('31/03/2024','dd/mm/yyyy') and ((Fosauda.Saudatype != 'B/' and Fosauda.Orignalno = 0) or (Fosauda.Saudatype = 'B/' and (Fosauda.Orignalno = -99 or Fosauda.Dtoftran=to_date('01/04/2023','dd/mm/yyyy')))) group by Fosauda.Oowncode, Company.Fibsacct, Company.Expirydate, Exchange.Operation, Company.Instrutyp, Company.nBaseunit, Company.cUnitofmeasurement, Company.cUnitofTrading, Company.nTradeablelot, Company.nPricenumerator, Company.nPricedenominator, Company.nGeneralnumerator, Company.nGeneraldenominator, Fosauda.Dtoftran, Fosauda.Final_Rat1, Fosauda.buysell, Fosauda.Compcode, Fosauda.Strikeprice, Fosauda.Saudatype, Fosauda.Optiontype), tblFocost as (Select tblFointernal.cClientcode as cClientcode, tblFointernal.cScripcode as cScripcode, tblFointernal.nStrikeprice as nStrikeprice, tblFointernal.cOptiontype as cOptiontype, tblFointernal.cScripname as cScripname, tblFointernal.cOperation as cOperation, tblFoInternal.cInstrutyp as cInstrutyp, tblFoInternal.nBaseunit as nBaseunit, tblFoInternal.cUnitofmeasurement as cUnitofmeasurement, tblFoInternal.cUnitofTrading as cUnitofTrading, tblFoInternal.nTradeablelot as nTradeablelot, tblFoInternal.nPricenumerator as nPricenumerator, tblFoInternal.nPricedenominator as nPricedenominator, tblFoInternal.nGeneralnumerator as nGeneralnumerator, tblFoInternal.nGeneraldenominator as nGeneraldenominator, tblFointernal.dExpirydate as dExpirydate, tblFointernal.dBuydate as dBuydate, tblFointernal.nBuynetrate as nBuynetrate, Case When tblFointernal.nNetquantity = 0 Then 0 When tblFointernal.nNetquantity > 0 Then Case When tblFointernal.nRunningbuytotal > tblFointernal.nNetquantity Then tblFointernal.nNetquantity + tblFointernal.nBuyquantity - tblFointernal.nRunningbuytotal Else tblFointernal.nBuyquantity End When tblFointernal.nNetquantity < 0 Then Case When abs(tblFointernal.nRunningselltotal) > abs(tblFointernal.nNetquantity) Then tblFointernal.nNetquantity - tblFointernal.nBuyquantity + tblFointernal.nRunningselltotal Else tblFointernal.nBuyquantity * -1 End End AS nStockquantity, tblFointernal.nSummarybuy as nSummarybuy, tblFointernal.nSumBuyamount as nSumbuyamount, tblFointernal.nSummarysell as nSummarysell, tblFointernal.nSumSellamount as nSumsellamount From tblFointernal tblFoInternal Where (tblFointernal.nNetquantity > 0 and tblFointernal.cBuysell = 'B' and tblFointernal.nRunningbuytotal <= tblFointernal.nNetquantity + tblFointernal.nBuyquantity) or (tblFointernal.nNetquantity < 0 and tblFointernal.cBuysell = 'S' and abs(tblFointernal.nRunningselltotal) <= Abs(tblFointernal.nNetquantity) + tblFointernal.nBuyquantity) or (tblFointernal.nNetquantity = 0 And tblFointernal.nRunningselltotal = tblFointernal.nSummarysell and tblFointernal.nRunningbuytotal = tblFointernal.nSummarybuy)), tblFinalcost as (Select tblFocost.cClientcode as cClientcode, tblFocost.cScripcode as cScripcode, tblFocost.nStrikeprice as nStrikeprice, tblFocost.cOptiontype as cOptiontype, tblFocost.dExpirydate as dExpirydate, tblFocost.cScripname as cScripname, tblFocost.cOperation as cOperation, tblFocost.cInstrutyp as cInstrutyp, tblFocost.nBaseunit as nBaseunit, tblFocost.cUnitofmeasurement as cUnitofmeasurement, tblFocost.cUnitofTrading as cUnitofTrading, tblFocost.nTradeablelot as nTradeablelot, tblFocost.nPricenumerator as nPricenumerator, tblFocost.nPricedenominator as nPricedenominator, tblFocost.nGeneralnumerator as nGeneralnumerator, tblFocost.nGeneraldenominator as nGeneraldenominator, tblFocost.nSummarybuy - (Case When Sum(tblFocost.nStockquantity) > 0 then Sum(tblFocost.nStockquantity) else 0 end) As nPurchqty, tblFocost.nSumbuyamount - (Case When Sum(tblFocost.nStockquantity) > 0 then Sum(tblFocost.nStockquantity * tblFocost.nBuyNetRate) else 0 end) As nPurchvalue, tblFocost.nSummarysell - (Case When Sum(tblFocost.nStockquantity) < 0 then Sum(Abs(tblFocost.nStockquantity)) else 0 end) as nSalesqty, tblFocost.nSumSellamount - (Case When Sum(tblFocost.nStockquantity) < 0 then Sum(Abs(tblFocost.nStockquantity) * tblFocost.nBuyNetRate) else 0 end) as nSalesvalue, Sum(tblFocost.nStockquantity) As nOsstock, Case When Sum(tblFocost.nStockquantity) != 0 then Round(Sum(tblFocost.nStockquantity * tblFocost.nBuyNetRate) / Sum(tblFocost.nStockquantity), 4) else 0 end as nOsstockavg, Sum(tblFocost.nStockquantity * tblFocost.nBuyNetRate) as nOsstockvalue, tblFocost.nSumSellamount + Sum(tblFocost.nStockquantity * tblFocost.nBuyNetRate) - tblFocost.nSumBuyamount as nProfitLoss, Max(Market.Market) as nMarketrate, Max(Market.Market) * Sum(tblFocost.nStockquantity) as nMarketvalue, ((tblFocost.nSumSellamount + Sum(tblFocost.nStockquantity * tblFocost.nBuyNetRate) - tblFocost.nSumBuyamount)) + ((Max(Market.Market) * Sum(tblFocost.nStockquantity)) - (Sum(tblFocost.nStockquantity * tblFocost.nBuyNetRate))) as nOverallprlo, Max(Market.nPrvcloseprice) as nPrvcloseprice, Max(Market.nHighprice) as nHighprice, Max(Market.nLowprice) as nLowprice, Max(Market.nLowercircuitLimit) as nLowercircuitlimit, Max(Market.nOpenprice) as nOpenprice, Max(Market.nUppercircuitlimit) as nUppercircuitlimit, Max(Market.nNoofTrades) as nNooftrades, Max(Market.nVoltradedToday) as nVoltradedtoday, Max(Market.nVolquantity) as nVolquantity, Max(Market.dLastupdatedate) as dlastupdatedate, Max(Market.n52Weeklow) as n52Weeklow, Max(Market.n52WeekHigh) as n52Weekhigh From tblFocost tblFocost Left Outer Join Market Market On Market.Firmnumber = 'NBS-000001' and tblFocost.cScripcode = Market.Code and tblFocost.nStrikeprice = Market.Strikeprice and tblFocost.cOptiontype = Market.Optiontype and ((Market.nOptmethod = 0 and tblFocost.nStrikeprice = 0) or (Market.nOptmethod = 1 and tblFocost.nStrikeprice != 0)) Group By tblFocost.cClientcode, tblFocost.cScripcode, tblFocost.cScripname, tblFocost.cOperation, tblFocost.cInstrutyp, tblFocost.nBaseunit, tblFocost.cUnitofmeasurement, tblFocost.cUnitofTrading, tblFocost.nTradeablelot, tblFocost.nPricenumerator, tblFocost.nPricedenominator, tblFocost.nGeneralnumerator, tblFocost.nGeneraldenominator, tblFocost.dExpirydate, tblFocost.nStrikeprice, tblFocost.cOptiontype, tblFocost.nSummarybuy, tblFocost.nSumBuyamount, tblFocost.nSummarysell, tblFocost.nSumSellamount), tblPortderfinal as (Select tblFinalcost.cClientcode as cClientcode, tblFinalcost.cScripcode as cScripcode, tblFinalcost.cScripname as cScripname, tblFinalcost.cOperation as cOperation, tblFinalcost.cInstrutyp as cInstrutyp, tblFinalcost.nBaseunit as nBaseunit, tblFinalcost.cUnitofmeasurement as cUnitofmeasurement, tblFinalcost.cUnitofTrading as cUnitofTrading, tblFinalcost.nTradeablelot as nTradeablelot, tblFinalcost.nPricenumerator as nPricenumerator, tblFinalcost.nPricedenominator as nPricedenominator, tblFinalcost.nGeneralnumerator as nGeneralnumerator, tblFinalcost.nGeneraldenominator as nGeneraldenominator, tblFinalcost.nStrikeprice as nStrikeprice, tblFinalcost.cOptiontype as cOptiontype, tblFinalcost.dExpirydate as dExpirydate, tblFinalcost.nPurchqty As nPurchqty, tblFinalcost.nPurchvalue As nPurchvalue, Round(Case When tblFinalcost.nPurchqty != 0 then tblFinalcost.nPurchvalue / tblFinalcost.nPurchqty else 0 End, 4) As nPurchavg, tblFinalcost.nSalesqty as nSalesqty, tblFinalcost.nSalesvalue as nSalesvalue, Round(Case When tblFinalcost.nSalesqty != 0 then tblFinalcost.nSalesvalue / tblFinalcost.nSalesqty else 0 end, 4) as nSalesavg, tblFinalcost.nOsstock As nOsstock, tblFinalcost.nOsstockavg as nOsstockavg, tblFinalcost.nOsstockvalue as nOsstockvalue, tblFinalcost.nMarketrate as nMarketrate, tblFinalcost.nMarketvalue as nMarketvalue, ((tblFinalcost.nMarketrate * tblFinalcost.nOsstock) - (tblFinalcost.nOsstock * tblFinalcost.nOsstockavg)) as nUnrealprlo, tblFinalcost.nProfitloss as nProfitLoss, tblFinalcost.nOverallprlo as nOverallprlo, tblFinalcost.nPrvcloseprice as nPrvcloseprice, tblFinalcost.nHighprice as nHighprice, tblFinalcost.nLowprice as nLowprice, tblFinalcost.nLowercircuitLimit as nLowercircuitlimit, tblFinalcost.nOpenprice as nOpenprice, tblFinalcost.nUppercircuitlimit as nUppercircuitlimit, tblFinalcost.nNooftrades as nNooftrades, tblFinalcost.nVoltradedtoday as nVoltradedtoday, tblFinalcost.nVolquantity as nVolquantity, tblFinalcost.dLastupdatedate as dlastupdatedate, tblFinalcost.n52WeekLow as n52Weeklow, tblFinalcost.n52Weekhigh as n52Weekhigh From tblFinalcost tblFinalcost Order by tblFinalcost.cClientcode, tblFinalcost.cScripname, tblFinalcost.nStrikeprice, tblFinalcost.cOptiontype, tblFinalcost.dExpirydate ), tblPortderfin as (Select tblPortderfinal.cClientcode as cClientcode, '05' as cRowindicator, Sum(tblPortderfinal.nProfitloss) as nFiramount, 0 as nSecamount From tblPortderfinal tblPortderfinal group by tblPortderfinal.cClientcode Union All Select tblPortderfinal.cClientcode as cClientcode, '09' as cRowindicator, Sum(tblPortderfinal.nUnrealprlo) as nFiramount, 0 as nSecamount From tblPortderfinal tblPortderfinal group by tblPortderfinal.cClientcode), tblCashplusderfinal as (Select Coalesce(tblPortcashfin.cClientcode,tblPortderfin.cClientcode) as cClientcode, Case When Coalesce(tblPortcashfin.cRowindicator,tblPortderfin.cRowindicator)='04' or Coalesce(tblPortcashfin.cRowindicator,tblPortderfin.cRowindicator)='05' then '06' else '10' end as cRowindicator, 0 as nFiramount, Sum(Coalesce(tblPortcashfin.nFiramount,tblPortderfin.nFiramount,0)) as nSecamount From tblPortcashfin Full outer join tblPortderfin On tblPortcashfin.cClientcode=tblPortderfin.cClientcode and tblPortcashfin.cRowindicator=tblPortderfin.cRowindicator Where tblPortcashfin.cRowindicator='04' or tblPortcashfin.cRowindicator='08' or tblPortderfin.cRowindicator='05' or tblPortderfin.cRowindicator='09' group by Coalesce(tblPortcashfin.cClientcode,tblPortderfin.cClientcode) , Case When Coalesce(tblPortcashfin.cRowindicator,tblPortderfin.cRowindicator)='04' or Coalesce(tblPortcashfin.cRowindicator,tblPortderfin.cRowindicator)='05' then '06' else '10' end ), tblDividend as (Select Ledger.Oowncode as cClientcode, '11' as cRowindicator, 0 as nFiramount, Sum(Ledger.damount-Ledger.Camount)*-1 as nSecamount From Ledger Ledger Inner Join Journal On Ledger.Firmnumber=Journal.Firmnumber and Ledger.Voucher=Journal.Jvnumber and Ledger.nFinancialyear=Journal.nFinancialyear Where Ledger.Firmnumber='NBS-000001' and Ledger.nFinancialyear=2024 and (Ledger.Oowncode='T5580011') and Ledger.Branchcode='T558' and Ledger.Dtoftran>=to_date('01/04/2023','dd/mm/yyyy') and Ledger.Dtoftran<=to_date('31/03/2024','dd/mm/yyyy') and Journal.nEntrytype=1 group by Ledger.Oowncode ), tblDirectDividend as (Select tblDirectdiv.cClientcode as cClientcode, '16' as cRowindicator, 0 as nFiramount, Sum(tblDirectdiv.nQuantity*tblDirectdiv.nRate)*-1 as nSecamount From tblDirectdiv tblDirectdiv Inner Join Ldfibs Ldfibs On tblDirectdiv.cFirmnumber = Ldfibs.Firmnumber and tblDirectdiv.cClientcode = Ldfibs.Oowncode Where tblDirectdiv.cFirmnumber='NBS-000001' and (tblDirectdiv.cClientcode='T5580011') and tblDirectdiv.dDtoftran>=to_date('01/04/2023','dd/mm/yyyy') and tblDirectdiv.dDtoftran<=to_date('31/03/2024','dd/mm/yyyy') group by tblDirectdiv.cClientcode ), tbltmpBillcharges as (Select Billcharges.Oowncode as cClientcode, Case When Billcharges.Egroup='FU' then '14' else '13' end as cRowindicator, Sum(Billcharges.Quantity*Billcharges.Final_Rat1) as nFiramount, 0 as nSecamount From Billcharges Billcharges Where Billcharges.Firmnumber='NBS-000001' and Billcharges.Brcode='T558' and (Billcharges.Oowncode='T5580011') and Billcharges.Dtoftran>=to_date('01/04/2023','dd/mm/yyyy') and Billcharges.Dtoftran<=to_date('31/03/2024','dd/mm/yyyy') group by Billcharges.Oowncode, Case When Billcharges.Egroup='FU' then '14' else '13' end ), tbltmpbillchgtotal as (Select tbltmpBillcharges.cClientcode as cClientcode, '12' as cRowindicator, 0 as nFiramount, Sum(tbltmpBillcharges.nFiramount) as nSecamount from tbltmpBillcharges tbltmpBillcharges group by tbltmpbillcharges.cClientcode ), tblMiscentries as ( Select Ledger.Oowncode as cClientcode, '15' as cRowindicator, 0 as nFiramount, Sum(Ledger.damount-Ledger.Camount)*-1 as nSecamount From Ledger Ledger Inner Join Journal On Ledger.Firmnumber=Journal.Firmnumber and Ledger.Voucher=Journal.Jvnumber and Ledger.nFinancialyear=Journal.nFinancialyear Where Ledger.Firmnumber='NBS-000001' and Ledger.nFinancialyear=2024 and (Ledger.Oowncode='T5580011') and Ledger.Branchcode='T558' and Ledger.Dtoftran>=to_date('01/04/2023','dd/mm/yyyy') and Ledger.Dtoftran<=to_date('31/03/2024','dd/mm/yyyy') and Journal.nEntrytype!=1 group by Ledger.Oowncode ), tbltempportalloc as (Select Coalesce(tblFinledger.cClientcode,tblPortcashfin.cClientcode) as cClientcode, '27' as cRowindicator, Sum(Nvl(tblFinledger.nFiramount,0)+Nvl(tblPortcashfin.nFiramount,0)) as nFiramount, 0 as nSecamount From tblFinledger tblFinledger Full Outer Join tblPortcashfin On tblFinledger.cClientcode=tblPortcashfin.cClientcode and tblFinledger.cRowindicator=tblPortcashfin.cRowindicator Where (tblFinledger.cRowindicator='26' or tblPortcashfin.cRowindicator='25') group by Coalesce(tblFinledger.cClientcode,tblPortcashfin.cClientcode) ), tbltemptotdays as (Select '18' as cRowindicator, (to_date('31/03/2024','dd/mm/yyyy') - to_date('01/04/2024','dd/mm/yyyy'))+1 as nSecamount From dual ), tblFinalloop as (Select tblReportdesc.cRowindicator as cRowindicator, tblReportdesc.cRowdesc as cRowdesc, Coalesce(tblReportdesc.cClientcode,tblOpenstk.cClientcode,tblCapinout.cClientcode,tblPortcashfin.cClientcode,tblPortderfin.cClientcode,tblCashplusderfinal.cClientcode,tblDividend.cClientcode,tbltmpbillcharges.cClientcode,tbltmpbillchgtotal.cClientcode,tblMiscentries.cClientcode,tblFinledger.cClientcode,tbltempPortalloc.cClientcode,tblDirectdividend.cClientcode) as cClientcode, Coalesce(tblOpenstk.nFiramount,tblCapinout.nFiramount,tblPortcashfin.nFiramount,tblPortderfin.nFiramount,tblCashplusderfinal.nFiramount,tblDividend.nFiramount,tbltmpBillcharges.nFiramount,tbltmpbillchgtotal.nFiramount,tblMiscentries.nFiramount,tblFinledger.nFiramount,tbltempPortalloc.nFiramount,tblDirectdividend.nFiramount) as nFiramount, Coalesce(tblOpenstk.nSecamount,tblCapinout.nSecamount,tblPortcashfin.nSecamount,tblPortderfin.nSecamount,tblCashplusderfinal.nSecamount,tblDividend.nSecamount,tbltmpBillcharges.nSecamount,tbltmpBillchgtotal.nSecamount,tblMiscentries.nSecamount,tblFinledger.nSecamount,tbltempPortalloc.nSecamount,tbltempTotdays.nSecamount,tbltempTotdays.nSecamount) as nSecamount From tblReportdesc tblReportdesc Left Outer Join tblOpenstk On tblReportdesc.cRowindicator=tblOpenstk.cRowindicator and tblReportdesc.cClientcode=tblOpenstk.cClientcode Left Outer Join tblCapinout On tblReportdesc.cRowindicator=tblCapinout.cRowindicator and tblReportdesc.cClientcode=tblCapinout.cClientcode Left Outer Join tblPortcashfin On tblReportdesc.cRowindicator=tblPortcashfin.cRowindicator and tblReportdesc.cClientcode=tblPortcashfin.cClientcode Left Outer Join tblPortderfin On tblReportdesc.cRowindicator=tblPortderfin.cRowindicator and tblReportdesc.cClientcode=tblPortderfin.cClientcode Left Outer Join tblCashplusderfinal On tblReportdesc.cRowindicator=tblCashplusderfinal.cRowindicator and tblReportdesc.cClientcode=tblCashplusderfinal.cClientcode Left Outer Join tblDividend On tblReportdesc.cRowindicator=tblDividend.cRowindicator and tblReportdesc.cClientcode=tblDividend.cClientcode Left Outer Join tbltmpBillcharges On tblReportdesc.cRowindicator=tbltmpBillcharges.cRowindicator and tblReportdesc.cClientcode=tbltmpBillcharges.cClientcode Left Outer Join tbltmpbillchgtotal On tblReportdesc.cRowindicator=tbltmpBillchgtotal.cRowindicator and tblReportdesc.cClientcode=tbltmpBillchgtotal.cClientcode Left Outer Join tblMiscentries On tblReportdesc.cRowindicator=tblMiscentries.cRowindicator and tblReportdesc.cClientcode=tblMiscentries.cClientcode Left Outer Join tblFinledger On tblReportdesc.cRowindicator=tblFinledger.cRowindicator and tblReportdesc.cClientcode=tblFinledger.cClientcode Left Outer Join tbltempPortalloc On tblReportdesc.cRowindicator=tbltempPortalloc.cRowindicator and tblReportdesc.cClientcode=tbltempPortalloc.cClientcode Left Outer Join tblDirectdividend On tblReportdesc.cRowindicator=tblDirectdividend.cRowindicator and tblReportdesc.cClientcode=tblDirectdividend.cClientcode Left Outer Join tbltemptotdays On tblReportdesc.cRowindicator=tbltempTotdays.cRowindicator ), tbltempporttotal as ( Select '17' as cRowindicator, tblFinalloop.cClientcode as cClientcode, Sum(tblFinalloop.nSecamount) as nTotalamount From tblFinalloop Where tblFinalloop.cRowindicator!='18' and nvl(trim(tblFinalloop.cClientcode),' ')!=' ' group by tblFinalloop.cClientcode ), tbltemptotalcapital as ( Select tblFinalloop.cClientcode as cClientcode, Sum(tblFinalloop.nSecamount) as nTotalamount From tblFinalloop tblFinalloop Where (tblFinalloop.cRowindicator='02' or tblFinalloop.cRowindicator='01') and nvl(trim(tblFinalloop.cClientcode),' ')!=' ' group by tblFinalloop.cClientcode ) Select tblFinalloop.cRowindicator as cRowindicator, tblFinalloop.cRowdesc as cRowdesc, tblFinalloop.cClientcode as cClientcode, tblFinalloop.nFiramount as nFiramount, Case When (tblFinalloop.cRowindicator=25 or tblFinalloop.cRowindicator=26) and tbltempPortalloc.nFiramount!=0 then Round(tblFinalloop.nFiramount/tbltempPortalloc.nFiramount*100,2) When tblFInalloop.cRowindicator='17' then tbltempporttotal.nTotalamount When tblFinalloop.cRowindicator='19' and tbltemptotalcapital.nTotalamount!=0 then Round((tbltempporttotal.nTotalamount-tbltemptotalcapital.nTotalamount)*100/tbltemptotalcapital.nTotalamount,2) When tblFinalloop.cRowindicator='20' and tbltemptotalcapital.nTotalamount!=0 then Round(((tbltempporttotal.nTotalamount-tbltemptotalcapital.nTotalamount)*100/tbltemptotalcapital.nTotalamount)*365/ ((to_date('31/03/2024','dd/mm/yyyy') - to_date('01/04/2024','dd/mm/yyyy')+1)),2) else tblFinalloop.nSecamount end as nSecamount From tblFinalloop Left Outer Join tbltempportalloc On tblFinalloop.cClientcode=tbltempportalloc.cClientcode Left Outer Join tbltempporttotal On tblFinalloop.cClientcode=tbltempporttotal.cClientcode Left Outer Join tbltemptotalcapital On tblFinalloop.cClientcode=tbltemptotalcapital.cClientcode Order by 1 Title : 01~Error Description : ORA-01476: divisor is equal to zero Method : getglobalportfolioLine : 44015 Message : getGlobalportfolio StackTrace : at OracleInternal.ServiceObjects.OracleConnectionImpl.VerifyExecution(Int32& cursorId, Boolean bThrowArrayBindRelatedErrors, SqlStatementType sqlStatementType, Int32 arrayBindCount, OracleException& exceptionForArrayBindDML, Boolean& hasMoreRowsInDB, Boolean bFirstIterationDone) at OracleInternal.ServiceObjects.OracleCommandImpl.ExecuteReader(String commandText, OracleParameterCollection paramColl, CommandType commandType, OracleConnectionImpl connectionImpl, OracleDataReaderImpl& rdrImpl, Int32 longFetchSize, Int64 clientInitialLOBFS, OracleDependencyImpl orclDependencyImpl, Int64[] scnForExecution, Int64[]& scnFromExecution, OracleParameterCollection& bindByPositionParamColl, Boolean& bBindParamPresent, Int64& internalInitialLOBFS, OracleException& exceptionForArrayBindDML, OracleConnection connection, OracleLogicalTransaction& oracleLogicalTransaction, IEnumerable`1 adrianParsedStmt, Boolean isDescribeOnly, Boolean isFromEF) at Oracle.ManagedDataAccess.Client.OracleCommand.ExecuteReader(Boolean requery, Boolean fillRequest, CommandBehavior behavior) at Oracle.ManagedDataAccess.Client.OracleDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable) at clientlevel.Thinclientlevel.Clientlogin.getglobalportfolio(DateTime tdStartdate, DateTime tdEnddate, DateTime tdPoadate, DateTime tdFinancialstartdate, Int32 tnAngleselection, String tcClientfilter, Cliole loLdcommon) in File25:line 44015 Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 858943488 Shut down : N Username : MOBBO Date/Time : 17/05/2024 9:09:03 PM Connection : Closed =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : F2660005 With tbltempReport as (Select '01' as cRowindicator, 'Opening Market Value' as cRowdesc From Dual Union All Select '02' as cRowindicator, 'Capital In(+)/Out(-)' as cRowdesc From Dual Union All Select '03' as cRowindicator, Rpad(' ',8)||'Realized Profit (+)/(-)' as cRowdesc From dual Union All Select '04' as cRowindicator, 'Cash Segment' as cRowdesc From dual Union All Select '05' as cRowindicator, 'Derivatives Segment' as cRowdesc From dual Union All Select '06' as cRowindicator, 'Total Realized Profit(+)/(-) ' as cRowdesc From dual Union All Select '07' as cRowindicator, Rpad(' ',8)||'Un-Realized Profit (+)/(-) ' as cRowdesc From dual Union All Select '08' as cRowindicator, 'Cash Segment' as cRowdesc From dual Union All Select '09' as cRowindicator, 'Derivatives Segment' as cRowdesc From dual Union All Select '10' as cRowindicator, 'Total Un-Realized Profit(+)/(-) ' as cRowdesc From dual Union All Select '11' as cRowindicator, 'Total Dividend Amount' as cRowdesc From dual Union All Select '12' as cRowindicator, Rpad(' ',8)||'Statutory Charges' as cRowdesc From dual Union All Select '13' as cRowindicator, 'Cash Segment' as cRowdesc From dual Union All Select '14' as cRowindicator, 'Derivatives Segment' as cRowdesc From dual Union All Select '15' as cRowindicator, 'Misc. JV Entries' as cRowdesc From dual Union All Select '16' as cRowindicator, 'Direct Dividend Credit' as cRowdesc From dual Union All Select '17' as cRowindicator, 'Total Portfolio Allocation' as cRowdesc From dual Union All Select '18' as cRowindicator, 'Total No. of Days' as cRowdesc From dual Union All Select '19' as cRowindicator, 'Absolute Return' as cRowdesc From dual Union All Select '20' as cRowindicator, 'Annualized Return' as cRowdesc From dual Union All Select '24' as cRowindicator, Rpad(' ',8)||'Portfolio Allocation' as cRowdesc From dual Union All Select '25' as cRowindicator, 'Equity' as cRowdesc From dual Union All Select '26' as cRowindicator, 'Cash and Equivalent' as cRowdesc From dual Union All Select '27' as cRowindicator, 'Total Portfolio Allocation' as cRowdesc From dual ), tblReportdesc as (Select Ldfibs.Oowncode as cClientcode, tbltempReport.* From Ldfibs Ldfibs Left Outer Join tbltempReport On 1=1 Where Ldfibs.Firmnumber='NBS-000001' and (Ldfibs.Oowncode='F2660005') and Ldfibs.Brcode='341' ), tblOpendet as (Select Ledger.Oowncode as cClientcode, '01' as cRowindicator, Sum(Ledger.Damount-Ledger.Camount)*-1 as nSecamount From Ledger Ledger Where Ledger.Firmnumber='NBS-000001' and Ledger.nFinancialyear=2024 and (Ledger.Oowncode='F2660005') and Ledger.Branchcode='341' and Substr(Ledger.Voucher,1,4)='OPNG' group by Ledger.Oowncode Union All Select Sauda.Oowncode as cClientcode, '01' as cRowindicator, Sum(Sauda.Quantity*Sauda.Market) as nSecamount From Sauda Sauda Where Sauda.Egroup='OK' and Sauda.Firmnumber = 'NBS-000001' and (Sauda.Oowncode='F2660005') and Sauda.Brcode='341' group by Sauda.Oowncode ), tblOpenstk as (Select tblOpendet.cClientcode as cClientcode, Max(tblOpendet.cRowindicator) as cRowindicator, 0 as nFiramount, Sum(tblOpendet.nSecamount) as nSecamount From tblOpendet tblOpendet group by tblOpendet.cClientcode), tblCapinout as (Select Ledger.Oowncode as cClientcode, '02' as cRowindicator, 0 as nFiramount, Sum(Ledger.Damount-Ledger.Camount)*-1 as nSecamount From Ledger Ledger Where Ledger.Firmnumber='NBS-000001' and Ledger.nFinancialyear=2024 and (Ledger.Oowncode='F2660005') and Ledger.Branchcode='341' and Ledger.Dtoftran>=to_date('01/04/2023','dd/mm/yyyy') and Ledger.Dtoftran<=to_date('31/03/2024','dd/mm/yyyy') and (Substr(Ledger.Voucher,1,2)='RE' or Substr(Ledger.Voucher,1,2)='PY') group by Ledger.Oowncode ), tblFinledger as (Select Ledger.Oowncode as cClientcode, '26' as cRowindicator, Sum(Ledger.Damount-Ledger.Camount)*-1 as nFiramount, 0 as nSecamount From Ledger Ledger Where Ledger.Firmnumber='NBS-000001' and Ledger.nFinancialyear=2024 and (Ledger.Oowncode='F2660005') and Ledger.Branchcode='341' and Ledger.Dtoftran>=to_date('01/04/2023','dd/mm/yyyy') and Ledger.Dtoftran<=to_date('31/03/2024','dd/mm/yyyy') group by Ledger.Oowncode ), tblCashinternal as (Select Sauda.Oowncode as cClientcode, Sauda.Compcode as cScripcode, Sauda.Dtoftran as dBuydate, Sauda.BuySell as cBuysell, Sum(Sauda.Quantity) as nBuyquantity, Case When Sum(Sauda.Brokpercontract) = 0 Then Avg(Sauda.Final_Rat1) Else Case When Sauda.BuySell = 'B' Then Round(((Sum(Sauda.Quantity) * Avg(Sauda.Final_Rat1)) + Sum(Sauda.Brokpercontract)) / Sum(Sauda.Quantity), 10) Else Round(((Sum(Sauda.Quantity) * Avg(Sauda.Final_Rat1)) - Sum(Sauda.Brokpercontract)) / Sum(Sauda.Quantity), 10) End End as nBuynetrate, Sum(Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, Sauda.Quantity * -1))) Over(Partition By Sauda.Oowncode, Sauda.Compcode Order By Sauda.Dtoftran, Sauda.Final_Rat1 rows between current row and unbounded following) as nRunningqty, Sum(Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, 0))) Over(Partition By Sauda.Oowncode, Sauda.Compcode Order By Sauda.Dtoftran, Sauda.Final_Rat1 rows between current row and unbounded following) as nRunningbuytotal, Sum(Sum(Decode(Sauda.Buysell, 'S', Sauda.Quantity, 0))) Over(Partition By Sauda.Oowncode, Sauda.Compcode Order By Sauda.Dtoftran, Sauda.Final_Rat1 rows between current row and unbounded following) as nRunningselltotal, Sum(Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, 0))) Over(Partition By Sauda.Oowncode, Sauda.Compcode) as nSummarybuy, Sum(Sum(Decode(Sauda.Buysell, 'S', Sauda.Quantity, 0))) Over(Partition By Sauda.Oowncode, Sauda.Compcode) as nSummarysell, Sum(Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, 0)) * Case When Sum(Sauda.Brokpercontract) = 0 Then Avg(Sauda.Final_Rat1) Else Case When Sauda.BuySell = 'B' Then Round(((Sum(Sauda.Quantity) * Avg(Sauda.Final_Rat1)) + Sum(Sauda.Brokpercontract)) / Sum(Sauda.Quantity), 10) Else 0 End End) Over(Partition By Sauda.Oowncode, Sauda.Compcode) as nSumBuyamount, Sum(Sum(Decode(Sauda.Buysell, 'S', Sauda.Quantity, 0)) * Case When Sum(Sauda.Brokpercontract) = 0 Then Avg(Sauda.Final_Rat1) Else Case When Sauda.BuySell = 'B' Then 0 Else Round(((Sum(Sauda.Quantity) * Avg(Sauda.Final_Rat1)) - Sum(Sauda.Brokpercontract)) / Sum(Sauda.Quantity), 10) End End) Over(Partition By Sauda.Oowncode, Sauda.Compcode) as nSumSellamount, Sum(Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, Sauda.Quantity * -1))) Over(Partition By Sauda.Oowncode, Sauda.Compcode) As nNetquantity From Sauda Sauda Where Sauda.Firmnumber='NBS-000001' and Sauda.Egroup!='YC' and Sauda.Egroup != 'LB' and Sauda.Egroup != 'SR' and Sauda.Egroup != 'LA' and Sauda.Sterminal != '99999' and Sauda.Dtoftran 0 Then Case When tblCashinternal.nRunningbuytotal > tblCashinternal.nNetquantity Then tblCashinternal.nNetquantity + tblCashinternal.nBuyquantity - tblCashinternal.nRunningbuytotal Else tblCashinternal.nBuyquantity End When tblCashinternal.nNetquantity < 0 Then Case When Abs(tblCashinternal.nRunningselltotal) > Abs(tblCashinternal.nNetquantity) Then tblCashinternal.nNetquantity - tblCashinternal.nBuyquantity + tblCashinternal.nRunningselltotal Else tblCashinternal.nBuyquantity * -1 End End) as nOpStockquantity, Sum((Case When tblCashinternal.nNetquantity = 0 Then 0 When tblCashinternal.nNetquantity > 0 Then Case When tblCashinternal.nRunningbuytotal > tblCashinternal.nNetquantity Then tblCashinternal.nNetquantity + tblCashinternal.nBuyquantity - tblCashinternal.nRunningbuytotal Else tblCashinternal.nBuyquantity End When tblCashinternal.nNetquantity < 0 Then Case When Abs(tblCashinternal.nRunningselltotal) > Abs(tblCashinternal.nNetquantity) Then tblCashinternal.nNetquantity - tblCashinternal.nBuyquantity + tblCashinternal.nRunningselltotal Else tblCashinternal.nBuyquantity * -1 End End) * tblCashinternal.nBuynetrate) as nOpStockAmount from tblCashinternal Where (tblCashinternal.nNetquantity > 0 And tblCashinternal.cBuysell = 'B' And tblCashinternal.nRunningbuytotal <= tblCashinternal.nNetquantity + tblCashinternal.nBuyquantity) or (tblCashinternal.nNetquantity < 0 and tblCashinternal.cBuysell = 'S' and Abs(tblCashinternal.nRunningselltotal) <= Abs(tblCashinternal.nNetquantity) + tblCashinternal.nBuyquantity) Group By tblCashinternal.cClientcode, tblCashinternal.cScripcode), tblCashinternal1 as (Select Sauda.Oowncode as cClientcode, Sauda.Compcode as cScripcode, Sauda.Dtoftran as dBuydate, Sauda.BuySell as cBuysell, Sum(Sauda.Quantity) as nBuyquantity, Case When Sum(Sauda.Brokpercontract) = 0 Then Avg(Sauda.Final_Rat1) Else Case When Sauda.BuySell = 'B' Then Round(((Sum(Sauda.Quantity) * Avg(Sauda.Final_Rat1)) + Sum(Sauda.Brokpercontract)) / Sum(Sauda.Quantity), 10) Else Round(((Sum(Sauda.Quantity) * Avg(Sauda.Final_Rat1)) - Sum(Sauda.Brokpercontract)) / Sum(Sauda.Quantity), 10) End End as nBuynetrate, Sum(Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, Sauda.Quantity * -1))) Over(Partition By Sauda.Oowncode, Sauda.Compcode Order By Sauda.Dtoftran, Sauda.Final_Rat1 rows between current row and unbounded following) as nRunningqty, Sum(Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, 0))) Over(Partition By Sauda.Oowncode, Sauda.Compcode Order By Sauda.Dtoftran, Sauda.Final_Rat1 rows between current row and unbounded following) as nRunningbuytotal, Sum(Sum(Decode(Sauda.Buysell, 'S', Sauda.Quantity, 0))) Over(Partition By Sauda.Oowncode, Sauda.Compcode Order By Sauda.Dtoftran, Sauda.Final_Rat1 rows between current row and unbounded following) as nRunningselltotal, Sum(Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, 0))) Over(Partition By Sauda.Oowncode, Sauda.Compcode) as nSummarybuy, Sum(Sum(Decode(Sauda.Buysell, 'S', Sauda.Quantity, 0))) Over(Partition By Sauda.Oowncode, Sauda.Compcode) as nSummarysell, Sum(Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, 0)) * Case When Sum(Sauda.Brokpercontract) = 0 Then Avg(Sauda.Final_Rat1) Else Case When Sauda.BuySell = 'B' Then Round(((Sum(Sauda.Quantity) * Avg(Sauda.Final_Rat1)) + Sum(Sauda.Brokpercontract)) / Sum(Sauda.Quantity), 10) Else 0 End End) Over(Partition By Sauda.Oowncode, Sauda.Compcode) as nSumBuyamount, Sum(Sum(Decode(Sauda.Buysell, 'S', Sauda.Quantity, 0)) * Case When Sum(Sauda.Brokpercontract) = 0 Then Avg(Sauda.Final_Rat1) Else Case When Sauda.BuySell = 'B' Then 0 Else Round(((Sum(Sauda.Quantity) * Avg(Sauda.Final_Rat1)) - Sum(Sauda.Brokpercontract)) / Sum(Sauda.Quantity), 10) End End) Over(Partition By Sauda.Oowncode, Sauda.Compcode) as nSumSellamount, Sum(Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, Sauda.Quantity * -1))) Over(Partition By Sauda.Oowncode, Sauda.Compcode) As nNetquantity From Sauda Sauda Where Sauda.Firmnumber='NBS-000001' and Sauda.Egroup!='YC' and Sauda.Egroup != 'LB' and Sauda.Egroup != 'SR' and Sauda.Egroup != 'LA' and Sauda.Sterminal != '99999' and Sauda.Dtoftran<=to_date('31/03/2024','dd/mm/yyyy') and Sauda.Brcode='341' and (Sauda.Oowncode='F2660005') group by Sauda.Oowncode, Sauda.Dtoftran, Sauda.Final_Rat1, Sauda.buysell, Sauda.Compcode), tblClosing as (Select tblCashinternal1.cClientcode as cClientcode, tblCashinternal1.cScripcode as cScripcode, Sum(Case When tblCashinternal1.nNetquantity = 0 Then 0 When tblCashinternal1.nNetquantity > 0 Then Case When tblCashinternal1.nRunningbuytotal > tblCashinternal1.nNetquantity Then tblCashinternal1.nNetquantity + tblCashinternal1.nBuyquantity - tblCashinternal1.nRunningbuytotal Else tblCashinternal1.nBuyquantity End When tblCashinternal1.nNetquantity < 0 Then Case When Abs(tblCashinternal1.nRunningselltotal) > Abs(tblCashinternal1.nNetquantity) Then tblCashinternal1.nNetquantity - tblCashinternal1.nBuyquantity + tblCashinternal1.nRunningselltotal Else tblCashinternal1.nBuyquantity * -1 End End) AS nCLStockquantity, Sum((Case When tblCashinternal1.nNetquantity = 0 Then 0 When tblCashinternal1.nNetquantity > 0 Then Case When tblCashinternal1.nRunningbuytotal > tblCashinternal1.nNetquantity Then tblCashinternal1.nNetquantity + tblCashinternal1.nBuyquantity - tblCashinternal1.nRunningbuytotal Else tblCashinternal1.nBuyquantity End When tblCashinternal1.nNetquantity < 0 Then Case When Abs(tblCashinternal1.nRunningselltotal) > Abs(tblCashinternal1.nNetquantity) Then tblCashinternal1.nNetquantity - tblCashinternal1.nBuyquantity + tblCashinternal1.nRunningselltotal Else tblCashinternal1.nBuyquantity * -1 End End) * tblCashinternal1.nBuynetrate) as nClStockAmount from tblCashinternal1 Where (tblCashinternal1.nNetquantity > 0 And tblCashinternal1.cBuysell = 'B' And tblCashinternal1.nRunningbuytotal <= tblCashinternal1.nNetquantity + tblCashinternal1.nBuyquantity) or (tblCashinternal1.nNetquantity < 0 and tblCashinternal1.cBuysell = 'S' and Abs(tblCashinternal1.nRunningselltotal) <= Abs(tblCashinternal1.nNetquantity) + tblCashinternal1.nBuyquantity) Group By tblCashinternal1.cClientcode, tblCashinternal1.cScripcode), tblBuYSell as (Select Sauda.Oowncode as cClientcode, Sauda.Compcode as cScripcode, Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, 0)) as nbuyQty, Sum(Decode(Sauda.Buysell, 'S', Sauda.Quantity, 0)) as nsellQty, Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity * Sauda.Final_Rat1 , 0)+Case When Sauda.Buysell='B' then Sauda.Brokpercontract else 0 end) as nBuyamount, Sum(Decode(Sauda.Buysell, 'S', Sauda.Quantity * Sauda.Final_Rat1 , 0)-Case When Sauda.Buysell='S' then Sauda.Brokpercontract else 0 end) as nSellamount From Sauda Sauda Where Sauda.Firmnumber='NBS-000001' and Sauda.Egroup!='YC' and Sauda.Egroup != 'LB' and Sauda.Egroup != 'SR' and Sauda.Egroup != 'LA' and Sauda.Sterminal != '99999' and Sauda.Dtoftran>=to_date('01/04/2023','dd/mm/yyyy') and Sauda.Dtoftran<=to_Date('31/03/2024','dd/mm/yyyy') and Sauda.Brcode='341' and (Sauda.Oowncode='F2660005') group by Sauda.Oowncode, Sauda.Compcode), tblCashcost as (Select Coalesce(tblOpening.cClientcode,tblClosing.cClientcode,tblBuysell.cClientcode) as cClientcode, Coalesce(tblOpening.cScripcode,tblClosing.cScripcode,tblBuysell.cScripcode) as cScripcode, Nvl(tblOpening.nOpstockquantity,0) as nOpstockquantity, Nvl(tblOpening.nOpstockamount,0) as nOpstockamount, Case When Nvl(tblOpening.nOpstockquantity,0)!=0 then Round(Nvl(tblOpening.nOpstockamount,0)/Nvl(tblOpening.nOpstockquantity,0),4) else 0 end as nOpstockavg, Nvl(tblBuysell.nBuyqty,0) as nPrePurchqty, Nvl(tblBuysell.nBuyamount,0) as nPrePurchvalue, Case When Nvl(tblBuysell.nBuyqty,0) !=0 then Round(Nvl(tblBuysell.nBuyamount,0)/Nvl(tblBuysell.nBuyqty,0),4) else 0 end as nPrePurchavg, Nvl(tblBuysell.nSellQty, 0) as nPreSellqty, Nvl(tblBuysell.nSellamount, 0) as nPreSellvalue, Case When Nvl(tblBuysell.nSellQty, 0) != 0 then Round(Nvl(tblBuysell.nSellamount, 0) / Nvl(tblBuysell.nSellQty, 0), 4) else 0 end as nPreSellavg, Least((Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockquantity, 0) + Nvl(tblBuysell.nBuyqty, 0) Else Nvl(tblBuysell.nBuyqty, 0) End), (Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockquantity, 0)) + Nvl(tblBuysell.nSellqty, 0) Else Nvl(tblBuysell.nSellqty, 0) End)) as nPurchqty, Round((Case When (Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockquantity, 0) + Nvl(tblBuysell.nBuyqty, 0) Else Nvl(tblBuysell.nBuyqty, 0) End) <= (Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockquantity, 0)) + Nvl(tblBuysell.nSellqty, 0) Else Nvl(tblBuysell.nSellqty, 0) End) Then Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockAmount, 0) + Nvl(tblBuysell.nBuyAmount, 0) Else Nvl(tblBuysell.nBuyAmount, 0) End Else Nvl(tblBuysell.nBuyAmount, 0) + Nvl(tblOpening.nOpstockAmount, 0) - nvl(tblClosing.nClStockAmount, 0) End), 2) as nPurchvalue, Round((Case When Least((Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockquantity, 0) + Nvl(tblBuysell.nBuyqty, 0) Else Nvl(tblBuysell.nBuyqty, 0) End), (Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockquantity, 0)) + Nvl(tblBuysell.nSellqty, 0) Else Nvl(tblBuysell.nSellqty, 0) End)) != 0 Then (Case When (Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockquantity, 0) + Nvl(tblBuysell.nBuyqty, 0) Else Nvl(tblBuysell.nBuyqty, 0) End) <= (Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockquantity, 0)) + Nvl(tblBuysell.nSellqty, 0) Else Nvl(tblBuysell.nSellqty, 0) End) Then Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockAmount, 0) + Nvl(tblBuysell.nBuyAmount, 0) Else Nvl(tblBuysell.nBuyAmount, 0) End Else Nvl(tblBuysell.nBuyAmount, 0) + Nvl(tblOpening.nOpstockAmount, 0) - nvl(tblClosing.nClStockAmount, 0) End) / (Least((Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockquantity, 0) + Nvl(tblBuysell.nBuyqty, 0) Else Nvl(tblBuysell.nBuyqty, 0) End), (Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockquantity, 0)) + Nvl(tblBuysell.nSellqty, 0) Else Nvl(tblBuysell.nSellqty, 0) End))) Else 0 End), 4) as nPurchavg, Least((Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockquantity, 0) + Nvl(tblBuysell.nBuyqty, 0) Else Nvl(tblBuysell.nBuyqty, 0) End), (Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockquantity, 0)) + Nvl(tblBuysell.nSellqty, 0) Else Nvl(tblBuysell.nSellqty, 0) End)) as nSalesqty, Round((Case When (Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockquantity, 0) + Nvl(tblBuysell.nBuyqty, 0) Else Nvl(tblBuysell.nBuyqty, 0) End) >= (Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockquantity, 0)) + Nvl(tblBuysell.nSellqty, 0) Else Nvl(tblBuysell.nSellqty, 0) End) Then Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockAmount, 0)) + Nvl(tblBuysell.nSellAmount, 0) Else Nvl(tblBuysell.nSellAmount, 0) End Else Nvl(tblBuysell.nSellAmount, 0) - Nvl(tblOpening.nOpstockAmount, 0) + nvl(tblClosing.nClStockAmount, 0) End), 2) as nSalesvalue, Round((Case When Least((Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockquantity, 0) + Nvl(tblBuysell.nBuyqty, 0) Else Nvl(tblBuysell.nBuyqty, 0) End), (Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockquantity, 0)) + Nvl(tblBuysell.nSellqty, 0) Else Nvl(tblBuysell.nSellqty, 0) End)) != 0 Then (Case When (Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockquantity, 0) + Nvl(tblBuysell.nBuyqty, 0) Else Nvl(tblBuysell.nBuyqty, 0) End) >= (Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockquantity, 0)) + Nvl(tblBuysell.nSellqty, 0) Else Nvl(tblBuysell.nSellqty, 0) End) Then Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockAmount, 0)) + Nvl(tblBuysell.nSellAmount, 0) Else Nvl(tblBuysell.nSellAmount, 0) End Else Nvl(tblBuysell.nSellAmount, 0) - Nvl(tblOpening.nOpstockAmount, 0) + nvl(tblClosing.nClStockAmount, 0) End) / (Least((Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockquantity, 0) + Nvl(tblBuysell.nBuyqty, 0) Else Nvl(tblBuysell.nBuyqty, 0) End), (Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockquantity, 0)) + Nvl(tblBuysell.nSellqty, 0) Else Nvl(tblBuysell.nSellqty, 0) End))) ELse 0 End), 4) as nSalesavg, Nvl(tblClosing.nClstockquantity, 0) as nOsstock, Nvl(tblClosing.nClstockamount, 0) as nOsstockvalue, Case When Nvl(tblClosing.nClstockquantity, 0) != 0 then Round(Nvl(tblClosing.nClstockamount, 0) / Nvl(tblClosing.nClstockquantity, 0), 4) else 0 end as nOsstockavg, (nvl(tblBuySell.nSellAmount, 0) - nvl(tblOpening.nOpStockAmount, 0) - nvl(tblBuySell.nBuyAmount, 0) + nvl(tblClosing.nClStockAmount, 0)) as nProfitloss, ((Market.Market * nvl(tblClosing.nClstockquantity, 0)) - Nvl(tblClosing.nClstockamount, 0)) As nUnrealprlo, (nvl(tblBuySell.nSellAmount, 0) - nvl(tblOpening.nOpStockAmount, 0) - nvl(tblBuySell.nBuyAmount, 0) + nvl(tblClosing.nClStockAmount, 0)) + ((Market.Market * nvl(tblClosing.nClstockquantity, 0)) - Nvl(tblClosing.nClstockamount, 0)) As nOverallprlo, Market.Market as nMarketrate, Market.Market*Nvl(tblClosing.nClstockquantity,0) As nMarketvalue from tblOPening tblOpening Full Join TblClosing on tblOpening.cclientcode = tblclosing.cclientcode and tblOPening.cScripcode = tblClosing.cScripcode Full Join TblBuySell on tblBuySell.cclientcode = coalesce(tblOpening.cclientcode, tblclosing.cclientcode) and tblBuySell.cScripcode = coalesce(tblOPening.cScripcode, tblClosing.cScripcode) Left Outer Join Market Market On Market.Firmnumber='NBS-000001' and Market.code=coalesce(tblOpening.cScripcode, tblclosing.cScripcode, tblBuysell.cScripcode) ), tblOpendet as (Select Ledger.Oowncode as cClientcode, '01' as cRowindicator, Sum(Ledger.Damount-Ledger.Camount)*-1 as nSecamount From Ledger Ledger Where Ledger.Firmnumber='NBS-000001' and Ledger.nFinancialyear = 2024 and (Ledger.Oowncode='F2660005') and Ledger.Branchcode='341' and Substr(Ledger.Voucher,1,4)='OPNG' group by Ledger.Oowncode Union All Select tblCashcost.cClientcode as cClientcode, '01' as cRowindicator, Sum(tblCashcost.nOpstockamount) as nSecamount From tblCashcost tblCashcost group by tblCashcost.cClientcode ), tblOpenstk as (Select tblOpendet.cClientcode as cClientcode, Max(tblOpendet.cRowindicator) as cRowindicator, 0 as nFiramount, Sum(tblOpendet.nSecamount) as nSecamount From tblOpendet tblOpendet group by tblOpendet.cClientcode), tblPortcashfin as (Select tblCashcost.cClientcode as cClientcode, '04' as cRowindicator, Sum(tblCashcost.nProfitloss) as nFiramount, 0 as nSecamount From tblCashcost tblCashcost group by tblCashcost.cClientcode Union All Select tblCashcost.cClientcode as cClientcode, '25' as cRowindicator, Sum(tblCashcost.nMarketvalue) as nFiramount, 0 as nSecamount From tblCashcost tblCashcost group by tblCashcost.cClientcode Union All Select tblCashcost.cClientcode as cClientcode, '08' as cRowindicator, Sum(tblCashcost.nUnrealprlo) as nFiramount, 0 as nSecamount From tblCashcost tblCashcost group by tblCashcost.cClientcode ), tblFointernal as (Select Fosauda.Oowncode as cClientcode, Fosauda.Compcode as cScripcode, Fosauda.Strikeprice as nStrikeprice, Fosauda.Optiontype as cOptiontype, Company.Fibsacct as cScripname, Company.Expirydate as dExpirydate, Exchange.Operation as cOperation, Company.Instrutyp as cInstrutyp, Company.nBaseunit as nBaseunit, Company.cUnitofmeasurement as cUnitofmeasurement, Company.cUnitofTrading as cUnitofTrading, Company.nTradeablelot as nTradeablelot, Company.nPricenumerator as nPricenumerator, Company.nPricedenominator as nPricedenominator, Company.nGeneralnumerator as nGeneralnumerator, Company.nGeneraldenominator as nGeneraldenominator, Fosauda.Dtoftran as dBuydate, Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') or Fosauda.Optiontype != 'PO' Then Fosauda.Buysell else Case When Fosauda.Buysell = 'B' Then 'S' Else 'B' End end as cBuysell, Sum(Fosauda.quantity) as nBuyquantity, Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') Then Case When Sum(Fosauda.nValuebrokerage) = 0 then Avg(Fosauda.Final_Rat1) else Case When Fosauda.BuySell = 'B' Then Round(((Sum(Fosauda.Quantity) * Avg(Fosauda.Final_Rat1)) + Sum(Fosauda.nValuebrokerage)) / Sum(Fosauda.Quantity), 10) Else Round(((Sum(Fosauda.Quantity) * Avg(Fosauda.Final_Rat1)) - Sum(Fosauda.nValuebrokerage)) / Sum(Fosauda.Quantity), 10) End End Else Case When Fosauda.Buysell = 'B' Then Avg(Fosauda.Final_rat1) - Avg(Fosauda.Strikeprice) else Avg(Fosauda.Strikeprice) - Avg(Fosauda.Final_rat1) End End as nBuynetrate, Sum(Sum(Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') or Fosauda.Optiontype != 'PO' Then Decode(Fosauda.Buysell, 'B', Fosauda.Quantity, Fosauda.Quantity * -1) Else Decode(Fosauda.Buysell, 'S', Fosauda.Quantity, Fosauda.Quantity * -1) End)) Over(Partition By Fosauda.Oowncode, Company.Fibsacct, Fosauda.Strikeprice, Fosauda.Optiontype Order By Fosauda.Dtoftran, Fosauda.Final_Rat1 rows between current row and unbounded following) as nRunningqty, Sum(Sum(Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') or Fosauda.optiontype != 'PO' Then Decode(Fosauda.Buysell, 'B', Fosauda.Quantity, 0) Else Decode(Fosauda.Buysell, 'S', Fosauda.Quantity, 0) End)) Over(Partition By Fosauda.Oowncode, Company.Fibsacct, Fosauda.Strikeprice, Fosauda.Optiontype Order By Fosauda.Dtoftran, Fosauda.Final_Rat1 rows between current row and unbounded following) as nRunningbuytotal, Sum(Sum(Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') or Fosauda.Optiontype != 'PO' Then Decode(Fosauda.Buysell, 'S', Fosauda.Quantity, 0) Else Decode(Fosauda.Buysell, 'B', Fosauda.Quantity, 0) End)) Over(Partition By Fosauda.Oowncode, Company.Fibsacct, Fosauda.Strikeprice, Fosauda.Optiontype Order By Fosauda.Dtoftran, Fosauda.Final_Rat1 rows between current row and unbounded following) as nRunningselltotal, Sum(Sum(Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') or Fosauda.optiontype != 'PO' Then Decode(Fosauda.Buysell, 'B', Fosauda.Quantity, 0) Else Decode(Fosauda.Buysell, 'S', Fosauda.Quantity, 0) End)) Over(Partition By Fosauda.Oowncode, Company.Fibsacct, Fosauda.Strikeprice, Fosauda.Optiontype) as nSummarybuy, Sum(Sum(Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') or Fosauda.optiontype != 'PO' Then Decode(Fosauda.Buysell, 'S', Fosauda.Quantity, 0) Else Decode(Fosauda.Buysell, 'B', Fosauda.Quantity, 0) End)) Over(Partition By Fosauda.Oowncode, Company.Fibsacct, Fosauda.Strikeprice, Fosauda.Optiontype) as nSummarysell, Sum(Sum(Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') or Fosauda.Optiontype != 'PO' Then Decode(Fosauda.Buysell, 'B', Fosauda.Quantity, 0) Else Decode(Fosauda.Buysell, 'S', Fosauda.Quantity, 0) End) * Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') Then Case When Sum(Fosauda.nValuebrokerage) = 0 then Avg(Fosauda.Final_Rat1) else Case When Fosauda.BuySell = 'B' Then Round(((Sum(Fosauda.Quantity) * Avg(Fosauda.Final_Rat1)) + Sum(Fosauda.nValuebrokerage)) / Sum(Fosauda.Quantity), 10) Else Round(((Sum(Fosauda.Quantity) * Avg(Fosauda.Final_Rat1)) - Sum(Fosauda.nValuebrokerage)) / Sum(Fosauda.Quantity), 10) End End Else Abs(Avg(Fosauda.Final_Rat1) - Avg(fosauda.strikeprice)) End) Over(Partition By Fosauda.Oowncode, Company.Fibsacct, Fosauda.Strikeprice, Fosauda.Optiontype) as nSumBuyamount, Sum(Sum(Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') or Fosauda.Optiontype != 'PO' Then Decode(Fosauda.Buysell, 'S', Fosauda.Quantity, 0) Else Decode(Fosauda.Buysell, 'B', Fosauda.Quantity, 0) End) * Case When (Fosauda.saudatype != 'AS' and Fosauda.Saudatype != 'EX') Then Case When Sum(Fosauda.nValuebrokerage) = 0 then Avg(Fosauda.Final_Rat1) else Case When Fosauda.BuySell = 'B' Then Round(((Sum(Fosauda.Quantity) * Avg(Fosauda.Final_Rat1)) + Sum(Fosauda.nValuebrokerage)) / Sum(Fosauda.Quantity), 10) Else Round(((Sum(Fosauda.Quantity) * Avg(Fosauda.Final_Rat1)) - Sum(Fosauda.nValuebrokerage)) / Sum(Fosauda.Quantity), 10) End End Else Abs(Avg(Fosauda.Final_Rat1) - Avg(fosauda.strikeprice)) End) Over(Partition By Fosauda.Oowncode, Company.Fibsacct, Fosauda.Strikeprice, Fosauda.Optiontype) as nSumSellamount, Sum(Sum(Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') or Fosauda.optiontype != 'PO' Then Decode(Fosauda.Buysell, 'B', Fosauda.Quantity, Fosauda.Quantity * -1) Else Decode(Fosauda.Buysell, 'S', Fosauda.Quantity, Fosauda.Quantity * -1) End)) Over(Partition By Fosauda.Oowncode, Company.Fibsacct, Fosauda.Strikeprice, Fosauda.Optiontype) As nNetquantity From Fosauda Fosauda Inner Join Company Company On Fosauda.firmnumber = Company.Firmnumber and Fosauda.Compcode = Company.oowncode Inner Join Exchange Exchange On Fosauda.Firmnumber = Exchange.Firmnumber and Fosauda.Exchcode = Exchange.Code Where Fosauda.Firmnumber = 'NBS-000001' and Fosauda.Egroup != 'YF' and Fosauda.Egroup != 'LB' and Fosauda.Egroup != 'SR' and Fosauda.Egroup != 'LA' and Fosauda.Sterminal != '99999' and (Fosauda.Oowncode='F2660005') and Fosauda.Brcode='341' and Fosauda.Dtoftran>=to_date('01/04/2023','dd/mm/yyyy') and Fosauda.Dtoftran<=to_date('31/03/2024','dd/mm/yyyy') and ((Fosauda.Saudatype != 'B/' and Fosauda.Orignalno = 0) or (Fosauda.Saudatype = 'B/' and (Fosauda.Orignalno = -99 or Fosauda.Dtoftran=to_date('01/04/2023','dd/mm/yyyy')))) group by Fosauda.Oowncode, Company.Fibsacct, Company.Expirydate, Exchange.Operation, Company.Instrutyp, Company.nBaseunit, Company.cUnitofmeasurement, Company.cUnitofTrading, Company.nTradeablelot, Company.nPricenumerator, Company.nPricedenominator, Company.nGeneralnumerator, Company.nGeneraldenominator, Fosauda.Dtoftran, Fosauda.Final_Rat1, Fosauda.buysell, Fosauda.Compcode, Fosauda.Strikeprice, Fosauda.Saudatype, Fosauda.Optiontype), tblFocost as (Select tblFointernal.cClientcode as cClientcode, tblFointernal.cScripcode as cScripcode, tblFointernal.nStrikeprice as nStrikeprice, tblFointernal.cOptiontype as cOptiontype, tblFointernal.cScripname as cScripname, tblFointernal.cOperation as cOperation, tblFoInternal.cInstrutyp as cInstrutyp, tblFoInternal.nBaseunit as nBaseunit, tblFoInternal.cUnitofmeasurement as cUnitofmeasurement, tblFoInternal.cUnitofTrading as cUnitofTrading, tblFoInternal.nTradeablelot as nTradeablelot, tblFoInternal.nPricenumerator as nPricenumerator, tblFoInternal.nPricedenominator as nPricedenominator, tblFoInternal.nGeneralnumerator as nGeneralnumerator, tblFoInternal.nGeneraldenominator as nGeneraldenominator, tblFointernal.dExpirydate as dExpirydate, tblFointernal.dBuydate as dBuydate, tblFointernal.nBuynetrate as nBuynetrate, Case When tblFointernal.nNetquantity = 0 Then 0 When tblFointernal.nNetquantity > 0 Then Case When tblFointernal.nRunningbuytotal > tblFointernal.nNetquantity Then tblFointernal.nNetquantity + tblFointernal.nBuyquantity - tblFointernal.nRunningbuytotal Else tblFointernal.nBuyquantity End When tblFointernal.nNetquantity < 0 Then Case When abs(tblFointernal.nRunningselltotal) > abs(tblFointernal.nNetquantity) Then tblFointernal.nNetquantity - tblFointernal.nBuyquantity + tblFointernal.nRunningselltotal Else tblFointernal.nBuyquantity * -1 End End AS nStockquantity, tblFointernal.nSummarybuy as nSummarybuy, tblFointernal.nSumBuyamount as nSumbuyamount, tblFointernal.nSummarysell as nSummarysell, tblFointernal.nSumSellamount as nSumsellamount From tblFointernal tblFoInternal Where (tblFointernal.nNetquantity > 0 and tblFointernal.cBuysell = 'B' and tblFointernal.nRunningbuytotal <= tblFointernal.nNetquantity + tblFointernal.nBuyquantity) or (tblFointernal.nNetquantity < 0 and tblFointernal.cBuysell = 'S' and abs(tblFointernal.nRunningselltotal) <= Abs(tblFointernal.nNetquantity) + tblFointernal.nBuyquantity) or (tblFointernal.nNetquantity = 0 And tblFointernal.nRunningselltotal = tblFointernal.nSummarysell and tblFointernal.nRunningbuytotal = tblFointernal.nSummarybuy)), tblFinalcost as (Select tblFocost.cClientcode as cClientcode, tblFocost.cScripcode as cScripcode, tblFocost.nStrikeprice as nStrikeprice, tblFocost.cOptiontype as cOptiontype, tblFocost.dExpirydate as dExpirydate, tblFocost.cScripname as cScripname, tblFocost.cOperation as cOperation, tblFocost.cInstrutyp as cInstrutyp, tblFocost.nBaseunit as nBaseunit, tblFocost.cUnitofmeasurement as cUnitofmeasurement, tblFocost.cUnitofTrading as cUnitofTrading, tblFocost.nTradeablelot as nTradeablelot, tblFocost.nPricenumerator as nPricenumerator, tblFocost.nPricedenominator as nPricedenominator, tblFocost.nGeneralnumerator as nGeneralnumerator, tblFocost.nGeneraldenominator as nGeneraldenominator, tblFocost.nSummarybuy - (Case When Sum(tblFocost.nStockquantity) > 0 then Sum(tblFocost.nStockquantity) else 0 end) As nPurchqty, tblFocost.nSumbuyamount - (Case When Sum(tblFocost.nStockquantity) > 0 then Sum(tblFocost.nStockquantity * tblFocost.nBuyNetRate) else 0 end) As nPurchvalue, tblFocost.nSummarysell - (Case When Sum(tblFocost.nStockquantity) < 0 then Sum(Abs(tblFocost.nStockquantity)) else 0 end) as nSalesqty, tblFocost.nSumSellamount - (Case When Sum(tblFocost.nStockquantity) < 0 then Sum(Abs(tblFocost.nStockquantity) * tblFocost.nBuyNetRate) else 0 end) as nSalesvalue, Sum(tblFocost.nStockquantity) As nOsstock, Case When Sum(tblFocost.nStockquantity) != 0 then Round(Sum(tblFocost.nStockquantity * tblFocost.nBuyNetRate) / Sum(tblFocost.nStockquantity), 4) else 0 end as nOsstockavg, Sum(tblFocost.nStockquantity * tblFocost.nBuyNetRate) as nOsstockvalue, tblFocost.nSumSellamount + Sum(tblFocost.nStockquantity * tblFocost.nBuyNetRate) - tblFocost.nSumBuyamount as nProfitLoss, Max(Market.Market) as nMarketrate, Max(Market.Market) * Sum(tblFocost.nStockquantity) as nMarketvalue, ((tblFocost.nSumSellamount + Sum(tblFocost.nStockquantity * tblFocost.nBuyNetRate) - tblFocost.nSumBuyamount)) + ((Max(Market.Market) * Sum(tblFocost.nStockquantity)) - (Sum(tblFocost.nStockquantity * tblFocost.nBuyNetRate))) as nOverallprlo, Max(Market.nPrvcloseprice) as nPrvcloseprice, Max(Market.nHighprice) as nHighprice, Max(Market.nLowprice) as nLowprice, Max(Market.nLowercircuitLimit) as nLowercircuitlimit, Max(Market.nOpenprice) as nOpenprice, Max(Market.nUppercircuitlimit) as nUppercircuitlimit, Max(Market.nNoofTrades) as nNooftrades, Max(Market.nVoltradedToday) as nVoltradedtoday, Max(Market.nVolquantity) as nVolquantity, Max(Market.dLastupdatedate) as dlastupdatedate, Max(Market.n52Weeklow) as n52Weeklow, Max(Market.n52WeekHigh) as n52Weekhigh From tblFocost tblFocost Left Outer Join Market Market On Market.Firmnumber = 'NBS-000001' and tblFocost.cScripcode = Market.Code and tblFocost.nStrikeprice = Market.Strikeprice and tblFocost.cOptiontype = Market.Optiontype and ((Market.nOptmethod = 0 and tblFocost.nStrikeprice = 0) or (Market.nOptmethod = 1 and tblFocost.nStrikeprice != 0)) Group By tblFocost.cClientcode, tblFocost.cScripcode, tblFocost.cScripname, tblFocost.cOperation, tblFocost.cInstrutyp, tblFocost.nBaseunit, tblFocost.cUnitofmeasurement, tblFocost.cUnitofTrading, tblFocost.nTradeablelot, tblFocost.nPricenumerator, tblFocost.nPricedenominator, tblFocost.nGeneralnumerator, tblFocost.nGeneraldenominator, tblFocost.dExpirydate, tblFocost.nStrikeprice, tblFocost.cOptiontype, tblFocost.nSummarybuy, tblFocost.nSumBuyamount, tblFocost.nSummarysell, tblFocost.nSumSellamount), tblPortderfinal as (Select tblFinalcost.cClientcode as cClientcode, tblFinalcost.cScripcode as cScripcode, tblFinalcost.cScripname as cScripname, tblFinalcost.cOperation as cOperation, tblFinalcost.cInstrutyp as cInstrutyp, tblFinalcost.nBaseunit as nBaseunit, tblFinalcost.cUnitofmeasurement as cUnitofmeasurement, tblFinalcost.cUnitofTrading as cUnitofTrading, tblFinalcost.nTradeablelot as nTradeablelot, tblFinalcost.nPricenumerator as nPricenumerator, tblFinalcost.nPricedenominator as nPricedenominator, tblFinalcost.nGeneralnumerator as nGeneralnumerator, tblFinalcost.nGeneraldenominator as nGeneraldenominator, tblFinalcost.nStrikeprice as nStrikeprice, tblFinalcost.cOptiontype as cOptiontype, tblFinalcost.dExpirydate as dExpirydate, tblFinalcost.nPurchqty As nPurchqty, tblFinalcost.nPurchvalue As nPurchvalue, Round(Case When tblFinalcost.nPurchqty != 0 then tblFinalcost.nPurchvalue / tblFinalcost.nPurchqty else 0 End, 4) As nPurchavg, tblFinalcost.nSalesqty as nSalesqty, tblFinalcost.nSalesvalue as nSalesvalue, Round(Case When tblFinalcost.nSalesqty != 0 then tblFinalcost.nSalesvalue / tblFinalcost.nSalesqty else 0 end, 4) as nSalesavg, tblFinalcost.nOsstock As nOsstock, tblFinalcost.nOsstockavg as nOsstockavg, tblFinalcost.nOsstockvalue as nOsstockvalue, tblFinalcost.nMarketrate as nMarketrate, tblFinalcost.nMarketvalue as nMarketvalue, ((tblFinalcost.nMarketrate * tblFinalcost.nOsstock) - (tblFinalcost.nOsstock * tblFinalcost.nOsstockavg)) as nUnrealprlo, tblFinalcost.nProfitloss as nProfitLoss, tblFinalcost.nOverallprlo as nOverallprlo, tblFinalcost.nPrvcloseprice as nPrvcloseprice, tblFinalcost.nHighprice as nHighprice, tblFinalcost.nLowprice as nLowprice, tblFinalcost.nLowercircuitLimit as nLowercircuitlimit, tblFinalcost.nOpenprice as nOpenprice, tblFinalcost.nUppercircuitlimit as nUppercircuitlimit, tblFinalcost.nNooftrades as nNooftrades, tblFinalcost.nVoltradedtoday as nVoltradedtoday, tblFinalcost.nVolquantity as nVolquantity, tblFinalcost.dLastupdatedate as dlastupdatedate, tblFinalcost.n52WeekLow as n52Weeklow, tblFinalcost.n52Weekhigh as n52Weekhigh From tblFinalcost tblFinalcost Order by tblFinalcost.cClientcode, tblFinalcost.cScripname, tblFinalcost.nStrikeprice, tblFinalcost.cOptiontype, tblFinalcost.dExpirydate ), tblPortderfin as (Select tblPortderfinal.cClientcode as cClientcode, '05' as cRowindicator, Sum(tblPortderfinal.nProfitloss) as nFiramount, 0 as nSecamount From tblPortderfinal tblPortderfinal group by tblPortderfinal.cClientcode Union All Select tblPortderfinal.cClientcode as cClientcode, '09' as cRowindicator, Sum(tblPortderfinal.nUnrealprlo) as nFiramount, 0 as nSecamount From tblPortderfinal tblPortderfinal group by tblPortderfinal.cClientcode), tblCashplusderfinal as (Select Coalesce(tblPortcashfin.cClientcode,tblPortderfin.cClientcode) as cClientcode, Case When Coalesce(tblPortcashfin.cRowindicator,tblPortderfin.cRowindicator)='04' or Coalesce(tblPortcashfin.cRowindicator,tblPortderfin.cRowindicator)='05' then '06' else '10' end as cRowindicator, 0 as nFiramount, Sum(Coalesce(tblPortcashfin.nFiramount,tblPortderfin.nFiramount,0)) as nSecamount From tblPortcashfin Full outer join tblPortderfin On tblPortcashfin.cClientcode=tblPortderfin.cClientcode and tblPortcashfin.cRowindicator=tblPortderfin.cRowindicator Where tblPortcashfin.cRowindicator='04' or tblPortcashfin.cRowindicator='08' or tblPortderfin.cRowindicator='05' or tblPortderfin.cRowindicator='09' group by Coalesce(tblPortcashfin.cClientcode,tblPortderfin.cClientcode) , Case When Coalesce(tblPortcashfin.cRowindicator,tblPortderfin.cRowindicator)='04' or Coalesce(tblPortcashfin.cRowindicator,tblPortderfin.cRowindicator)='05' then '06' else '10' end ), tblDividend as (Select Ledger.Oowncode as cClientcode, '11' as cRowindicator, 0 as nFiramount, Sum(Ledger.damount-Ledger.Camount)*-1 as nSecamount From Ledger Ledger Inner Join Journal On Ledger.Firmnumber=Journal.Firmnumber and Ledger.Voucher=Journal.Jvnumber and Ledger.nFinancialyear=Journal.nFinancialyear Where Ledger.Firmnumber='NBS-000001' and Ledger.nFinancialyear=2024 and (Ledger.Oowncode='F2660005') and Ledger.Branchcode='341' and Ledger.Dtoftran>=to_date('01/04/2023','dd/mm/yyyy') and Ledger.Dtoftran<=to_date('31/03/2024','dd/mm/yyyy') and Journal.nEntrytype=1 group by Ledger.Oowncode ), tblDirectDividend as (Select tblDirectdiv.cClientcode as cClientcode, '16' as cRowindicator, 0 as nFiramount, Sum(tblDirectdiv.nQuantity*tblDirectdiv.nRate)*-1 as nSecamount From tblDirectdiv tblDirectdiv Inner Join Ldfibs Ldfibs On tblDirectdiv.cFirmnumber = Ldfibs.Firmnumber and tblDirectdiv.cClientcode = Ldfibs.Oowncode Where tblDirectdiv.cFirmnumber='NBS-000001' and (tblDirectdiv.cClientcode='F2660005') and tblDirectdiv.dDtoftran>=to_date('01/04/2023','dd/mm/yyyy') and tblDirectdiv.dDtoftran<=to_date('31/03/2024','dd/mm/yyyy') group by tblDirectdiv.cClientcode ), tbltmpBillcharges as (Select Billcharges.Oowncode as cClientcode, Case When Billcharges.Egroup='FU' then '14' else '13' end as cRowindicator, Sum(Billcharges.Quantity*Billcharges.Final_Rat1) as nFiramount, 0 as nSecamount From Billcharges Billcharges Where Billcharges.Firmnumber='NBS-000001' and Billcharges.Brcode='341' and (Billcharges.Oowncode='F2660005') and Billcharges.Dtoftran>=to_date('01/04/2023','dd/mm/yyyy') and Billcharges.Dtoftran<=to_date('31/03/2024','dd/mm/yyyy') group by Billcharges.Oowncode, Case When Billcharges.Egroup='FU' then '14' else '13' end ), tbltmpbillchgtotal as (Select tbltmpBillcharges.cClientcode as cClientcode, '12' as cRowindicator, 0 as nFiramount, Sum(tbltmpBillcharges.nFiramount) as nSecamount from tbltmpBillcharges tbltmpBillcharges group by tbltmpbillcharges.cClientcode ), tblMiscentries as ( Select Ledger.Oowncode as cClientcode, '15' as cRowindicator, 0 as nFiramount, Sum(Ledger.damount-Ledger.Camount)*-1 as nSecamount From Ledger Ledger Inner Join Journal On Ledger.Firmnumber=Journal.Firmnumber and Ledger.Voucher=Journal.Jvnumber and Ledger.nFinancialyear=Journal.nFinancialyear Where Ledger.Firmnumber='NBS-000001' and Ledger.nFinancialyear=2024 and (Ledger.Oowncode='F2660005') and Ledger.Branchcode='341' and Ledger.Dtoftran>=to_date('01/04/2023','dd/mm/yyyy') and Ledger.Dtoftran<=to_date('31/03/2024','dd/mm/yyyy') and Journal.nEntrytype!=1 group by Ledger.Oowncode ), tbltempportalloc as (Select Coalesce(tblFinledger.cClientcode,tblPortcashfin.cClientcode) as cClientcode, '27' as cRowindicator, Sum(Nvl(tblFinledger.nFiramount,0)+Nvl(tblPortcashfin.nFiramount,0)) as nFiramount, 0 as nSecamount From tblFinledger tblFinledger Full Outer Join tblPortcashfin On tblFinledger.cClientcode=tblPortcashfin.cClientcode and tblFinledger.cRowindicator=tblPortcashfin.cRowindicator Where (tblFinledger.cRowindicator='26' or tblPortcashfin.cRowindicator='25') group by Coalesce(tblFinledger.cClientcode,tblPortcashfin.cClientcode) ), tbltemptotdays as (Select '18' as cRowindicator, (to_date('31/03/2024','dd/mm/yyyy') - to_date('01/04/2024','dd/mm/yyyy'))+1 as nSecamount From dual ), tblFinalloop as (Select tblReportdesc.cRowindicator as cRowindicator, tblReportdesc.cRowdesc as cRowdesc, Coalesce(tblReportdesc.cClientcode,tblOpenstk.cClientcode,tblCapinout.cClientcode,tblPortcashfin.cClientcode,tblPortderfin.cClientcode,tblCashplusderfinal.cClientcode,tblDividend.cClientcode,tbltmpbillcharges.cClientcode,tbltmpbillchgtotal.cClientcode,tblMiscentries.cClientcode,tblFinledger.cClientcode,tbltempPortalloc.cClientcode,tblDirectdividend.cClientcode) as cClientcode, Coalesce(tblOpenstk.nFiramount,tblCapinout.nFiramount,tblPortcashfin.nFiramount,tblPortderfin.nFiramount,tblCashplusderfinal.nFiramount,tblDividend.nFiramount,tbltmpBillcharges.nFiramount,tbltmpbillchgtotal.nFiramount,tblMiscentries.nFiramount,tblFinledger.nFiramount,tbltempPortalloc.nFiramount,tblDirectdividend.nFiramount) as nFiramount, Coalesce(tblOpenstk.nSecamount,tblCapinout.nSecamount,tblPortcashfin.nSecamount,tblPortderfin.nSecamount,tblCashplusderfinal.nSecamount,tblDividend.nSecamount,tbltmpBillcharges.nSecamount,tbltmpBillchgtotal.nSecamount,tblMiscentries.nSecamount,tblFinledger.nSecamount,tbltempPortalloc.nSecamount,tbltempTotdays.nSecamount,tbltempTotdays.nSecamount) as nSecamount From tblReportdesc tblReportdesc Left Outer Join tblOpenstk On tblReportdesc.cRowindicator=tblOpenstk.cRowindicator and tblReportdesc.cClientcode=tblOpenstk.cClientcode Left Outer Join tblCapinout On tblReportdesc.cRowindicator=tblCapinout.cRowindicator and tblReportdesc.cClientcode=tblCapinout.cClientcode Left Outer Join tblPortcashfin On tblReportdesc.cRowindicator=tblPortcashfin.cRowindicator and tblReportdesc.cClientcode=tblPortcashfin.cClientcode Left Outer Join tblPortderfin On tblReportdesc.cRowindicator=tblPortderfin.cRowindicator and tblReportdesc.cClientcode=tblPortderfin.cClientcode Left Outer Join tblCashplusderfinal On tblReportdesc.cRowindicator=tblCashplusderfinal.cRowindicator and tblReportdesc.cClientcode=tblCashplusderfinal.cClientcode Left Outer Join tblDividend On tblReportdesc.cRowindicator=tblDividend.cRowindicator and tblReportdesc.cClientcode=tblDividend.cClientcode Left Outer Join tbltmpBillcharges On tblReportdesc.cRowindicator=tbltmpBillcharges.cRowindicator and tblReportdesc.cClientcode=tbltmpBillcharges.cClientcode Left Outer Join tbltmpbillchgtotal On tblReportdesc.cRowindicator=tbltmpBillchgtotal.cRowindicator and tblReportdesc.cClientcode=tbltmpBillchgtotal.cClientcode Left Outer Join tblMiscentries On tblReportdesc.cRowindicator=tblMiscentries.cRowindicator and tblReportdesc.cClientcode=tblMiscentries.cClientcode Left Outer Join tblFinledger On tblReportdesc.cRowindicator=tblFinledger.cRowindicator and tblReportdesc.cClientcode=tblFinledger.cClientcode Left Outer Join tbltempPortalloc On tblReportdesc.cRowindicator=tbltempPortalloc.cRowindicator and tblReportdesc.cClientcode=tbltempPortalloc.cClientcode Left Outer Join tblDirectdividend On tblReportdesc.cRowindicator=tblDirectdividend.cRowindicator and tblReportdesc.cClientcode=tblDirectdividend.cClientcode Left Outer Join tbltemptotdays On tblReportdesc.cRowindicator=tbltempTotdays.cRowindicator ), tbltempporttotal as ( Select '17' as cRowindicator, tblFinalloop.cClientcode as cClientcode, Sum(tblFinalloop.nSecamount) as nTotalamount From tblFinalloop Where tblFinalloop.cRowindicator!='18' and nvl(trim(tblFinalloop.cClientcode),' ')!=' ' group by tblFinalloop.cClientcode ), tbltemptotalcapital as ( Select tblFinalloop.cClientcode as cClientcode, Sum(tblFinalloop.nSecamount) as nTotalamount From tblFinalloop tblFinalloop Where (tblFinalloop.cRowindicator='02' or tblFinalloop.cRowindicator='01') and nvl(trim(tblFinalloop.cClientcode),' ')!=' ' group by tblFinalloop.cClientcode ) Select tblFinalloop.cRowindicator as cRowindicator, tblFinalloop.cRowdesc as cRowdesc, tblFinalloop.cClientcode as cClientcode, tblFinalloop.nFiramount as nFiramount, Case When (tblFinalloop.cRowindicator=25 or tblFinalloop.cRowindicator=26) and tbltempPortalloc.nFiramount!=0 then Round(tblFinalloop.nFiramount/tbltempPortalloc.nFiramount*100,2) When tblFInalloop.cRowindicator='17' then tbltempporttotal.nTotalamount When tblFinalloop.cRowindicator='19' and tbltemptotalcapital.nTotalamount!=0 then Round((tbltempporttotal.nTotalamount-tbltemptotalcapital.nTotalamount)*100/tbltemptotalcapital.nTotalamount,2) When tblFinalloop.cRowindicator='20' and tbltemptotalcapital.nTotalamount!=0 then Round(((tbltempporttotal.nTotalamount-tbltemptotalcapital.nTotalamount)*100/tbltemptotalcapital.nTotalamount)*365/ ((to_date('31/03/2024','dd/mm/yyyy') - to_date('01/04/2024','dd/mm/yyyy')+1)),2) else tblFinalloop.nSecamount end as nSecamount From tblFinalloop Left Outer Join tbltempportalloc On tblFinalloop.cClientcode=tbltempportalloc.cClientcode Left Outer Join tbltempporttotal On tblFinalloop.cClientcode=tbltempporttotal.cClientcode Left Outer Join tbltemptotalcapital On tblFinalloop.cClientcode=tbltemptotalcapital.cClientcode Order by 1 Title : 01~Error Description : ORA-01476: divisor is equal to zero Method : getglobalportfolioLine : 44015 Message : getGlobalportfolio StackTrace : at OracleInternal.ServiceObjects.OracleConnectionImpl.VerifyExecution(Int32& cursorId, Boolean bThrowArrayBindRelatedErrors, SqlStatementType sqlStatementType, Int32 arrayBindCount, OracleException& exceptionForArrayBindDML, Boolean& hasMoreRowsInDB, Boolean bFirstIterationDone) at OracleInternal.ServiceObjects.OracleCommandImpl.ExecuteReader(String commandText, OracleParameterCollection paramColl, CommandType commandType, OracleConnectionImpl connectionImpl, OracleDataReaderImpl& rdrImpl, Int32 longFetchSize, Int64 clientInitialLOBFS, OracleDependencyImpl orclDependencyImpl, Int64[] scnForExecution, Int64[]& scnFromExecution, OracleParameterCollection& bindByPositionParamColl, Boolean& bBindParamPresent, Int64& internalInitialLOBFS, OracleException& exceptionForArrayBindDML, OracleConnection connection, OracleLogicalTransaction& oracleLogicalTransaction, IEnumerable`1 adrianParsedStmt, Boolean isDescribeOnly, Boolean isFromEF) at Oracle.ManagedDataAccess.Client.OracleCommand.ExecuteReader(Boolean requery, Boolean fillRequest, CommandBehavior behavior) at Oracle.ManagedDataAccess.Client.OracleDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable) at clientlevel.Thinclientlevel.Clientlogin.getglobalportfolio(DateTime tdStartdate, DateTime tdEnddate, DateTime tdPoadate, DateTime tdFinancialstartdate, Int32 tnAngleselection, String tcClientfilter, Cliole loLdcommon) in File25:line 44015 Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 881070080 Shut down : N Username : MOBBO Date/Time : 17/05/2024 9:09:16 PM Connection : Closed =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : F2660005 With tbltempReport as (Select '01' as cRowindicator, 'Opening Market Value' as cRowdesc From Dual Union All Select '02' as cRowindicator, 'Capital In(+)/Out(-)' as cRowdesc From Dual Union All Select '03' as cRowindicator, Rpad(' ',8)||'Realized Profit (+)/(-)' as cRowdesc From dual Union All Select '04' as cRowindicator, 'Cash Segment' as cRowdesc From dual Union All Select '05' as cRowindicator, 'Derivatives Segment' as cRowdesc From dual Union All Select '06' as cRowindicator, 'Total Realized Profit(+)/(-) ' as cRowdesc From dual Union All Select '07' as cRowindicator, Rpad(' ',8)||'Un-Realized Profit (+)/(-) ' as cRowdesc From dual Union All Select '08' as cRowindicator, 'Cash Segment' as cRowdesc From dual Union All Select '09' as cRowindicator, 'Derivatives Segment' as cRowdesc From dual Union All Select '10' as cRowindicator, 'Total Un-Realized Profit(+)/(-) ' as cRowdesc From dual Union All Select '11' as cRowindicator, 'Total Dividend Amount' as cRowdesc From dual Union All Select '12' as cRowindicator, Rpad(' ',8)||'Statutory Charges' as cRowdesc From dual Union All Select '13' as cRowindicator, 'Cash Segment' as cRowdesc From dual Union All Select '14' as cRowindicator, 'Derivatives Segment' as cRowdesc From dual Union All Select '15' as cRowindicator, 'Misc. JV Entries' as cRowdesc From dual Union All Select '16' as cRowindicator, 'Direct Dividend Credit' as cRowdesc From dual Union All Select '17' as cRowindicator, 'Total Portfolio Allocation' as cRowdesc From dual Union All Select '18' as cRowindicator, 'Total No. of Days' as cRowdesc From dual Union All Select '19' as cRowindicator, 'Absolute Return' as cRowdesc From dual Union All Select '20' as cRowindicator, 'Annualized Return' as cRowdesc From dual Union All Select '24' as cRowindicator, Rpad(' ',8)||'Portfolio Allocation' as cRowdesc From dual Union All Select '25' as cRowindicator, 'Equity' as cRowdesc From dual Union All Select '26' as cRowindicator, 'Cash and Equivalent' as cRowdesc From dual Union All Select '27' as cRowindicator, 'Total Portfolio Allocation' as cRowdesc From dual ), tblReportdesc as (Select Ldfibs.Oowncode as cClientcode, tbltempReport.* From Ldfibs Ldfibs Left Outer Join tbltempReport On 1=1 Where Ldfibs.Firmnumber='NBS-000001' and (Ldfibs.Oowncode='F2660005') and Ldfibs.Brcode='341' ), tblOpendet as (Select Ledger.Oowncode as cClientcode, '01' as cRowindicator, Sum(Ledger.Damount-Ledger.Camount)*-1 as nSecamount From Ledger Ledger Where Ledger.Firmnumber='NBS-000001' and Ledger.nFinancialyear=2024 and (Ledger.Oowncode='F2660005') and Ledger.Branchcode='341' and Substr(Ledger.Voucher,1,4)='OPNG' group by Ledger.Oowncode Union All Select Sauda.Oowncode as cClientcode, '01' as cRowindicator, Sum(Sauda.Quantity*Sauda.Market) as nSecamount From Sauda Sauda Where Sauda.Egroup='OK' and Sauda.Firmnumber = 'NBS-000001' and (Sauda.Oowncode='F2660005') and Sauda.Brcode='341' group by Sauda.Oowncode ), tblOpenstk as (Select tblOpendet.cClientcode as cClientcode, Max(tblOpendet.cRowindicator) as cRowindicator, 0 as nFiramount, Sum(tblOpendet.nSecamount) as nSecamount From tblOpendet tblOpendet group by tblOpendet.cClientcode), tblCapinout as (Select Ledger.Oowncode as cClientcode, '02' as cRowindicator, 0 as nFiramount, Sum(Ledger.Damount-Ledger.Camount)*-1 as nSecamount From Ledger Ledger Where Ledger.Firmnumber='NBS-000001' and Ledger.nFinancialyear=2024 and (Ledger.Oowncode='F2660005') and Ledger.Branchcode='341' and Ledger.Dtoftran>=to_date('01/04/2023','dd/mm/yyyy') and Ledger.Dtoftran<=to_date('31/03/2024','dd/mm/yyyy') and (Substr(Ledger.Voucher,1,2)='RE' or Substr(Ledger.Voucher,1,2)='PY') group by Ledger.Oowncode ), tblFinledger as (Select Ledger.Oowncode as cClientcode, '26' as cRowindicator, Sum(Ledger.Damount-Ledger.Camount)*-1 as nFiramount, 0 as nSecamount From Ledger Ledger Where Ledger.Firmnumber='NBS-000001' and Ledger.nFinancialyear=2024 and (Ledger.Oowncode='F2660005') and Ledger.Branchcode='341' and Ledger.Dtoftran>=to_date('01/04/2023','dd/mm/yyyy') and Ledger.Dtoftran<=to_date('31/03/2024','dd/mm/yyyy') group by Ledger.Oowncode ), tblCashinternal as (Select Sauda.Oowncode as cClientcode, Sauda.Compcode as cScripcode, Sauda.Dtoftran as dBuydate, Sauda.BuySell as cBuysell, Sum(Sauda.Quantity) as nBuyquantity, Case When Sum(Sauda.Brokpercontract) = 0 Then Avg(Sauda.Final_Rat1) Else Case When Sauda.BuySell = 'B' Then Round(((Sum(Sauda.Quantity) * Avg(Sauda.Final_Rat1)) + Sum(Sauda.Brokpercontract)) / Sum(Sauda.Quantity), 10) Else Round(((Sum(Sauda.Quantity) * Avg(Sauda.Final_Rat1)) - Sum(Sauda.Brokpercontract)) / Sum(Sauda.Quantity), 10) End End as nBuynetrate, Sum(Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, Sauda.Quantity * -1))) Over(Partition By Sauda.Oowncode, Sauda.Compcode Order By Sauda.Dtoftran, Sauda.Final_Rat1 rows between current row and unbounded following) as nRunningqty, Sum(Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, 0))) Over(Partition By Sauda.Oowncode, Sauda.Compcode Order By Sauda.Dtoftran, Sauda.Final_Rat1 rows between current row and unbounded following) as nRunningbuytotal, Sum(Sum(Decode(Sauda.Buysell, 'S', Sauda.Quantity, 0))) Over(Partition By Sauda.Oowncode, Sauda.Compcode Order By Sauda.Dtoftran, Sauda.Final_Rat1 rows between current row and unbounded following) as nRunningselltotal, Sum(Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, 0))) Over(Partition By Sauda.Oowncode, Sauda.Compcode) as nSummarybuy, Sum(Sum(Decode(Sauda.Buysell, 'S', Sauda.Quantity, 0))) Over(Partition By Sauda.Oowncode, Sauda.Compcode) as nSummarysell, Sum(Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, 0)) * Case When Sum(Sauda.Brokpercontract) = 0 Then Avg(Sauda.Final_Rat1) Else Case When Sauda.BuySell = 'B' Then Round(((Sum(Sauda.Quantity) * Avg(Sauda.Final_Rat1)) + Sum(Sauda.Brokpercontract)) / Sum(Sauda.Quantity), 10) Else 0 End End) Over(Partition By Sauda.Oowncode, Sauda.Compcode) as nSumBuyamount, Sum(Sum(Decode(Sauda.Buysell, 'S', Sauda.Quantity, 0)) * Case When Sum(Sauda.Brokpercontract) = 0 Then Avg(Sauda.Final_Rat1) Else Case When Sauda.BuySell = 'B' Then 0 Else Round(((Sum(Sauda.Quantity) * Avg(Sauda.Final_Rat1)) - Sum(Sauda.Brokpercontract)) / Sum(Sauda.Quantity), 10) End End) Over(Partition By Sauda.Oowncode, Sauda.Compcode) as nSumSellamount, Sum(Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, Sauda.Quantity * -1))) Over(Partition By Sauda.Oowncode, Sauda.Compcode) As nNetquantity From Sauda Sauda Where Sauda.Firmnumber='NBS-000001' and Sauda.Egroup!='YC' and Sauda.Egroup != 'LB' and Sauda.Egroup != 'SR' and Sauda.Egroup != 'LA' and Sauda.Sterminal != '99999' and Sauda.Dtoftran 0 Then Case When tblCashinternal.nRunningbuytotal > tblCashinternal.nNetquantity Then tblCashinternal.nNetquantity + tblCashinternal.nBuyquantity - tblCashinternal.nRunningbuytotal Else tblCashinternal.nBuyquantity End When tblCashinternal.nNetquantity < 0 Then Case When Abs(tblCashinternal.nRunningselltotal) > Abs(tblCashinternal.nNetquantity) Then tblCashinternal.nNetquantity - tblCashinternal.nBuyquantity + tblCashinternal.nRunningselltotal Else tblCashinternal.nBuyquantity * -1 End End) as nOpStockquantity, Sum((Case When tblCashinternal.nNetquantity = 0 Then 0 When tblCashinternal.nNetquantity > 0 Then Case When tblCashinternal.nRunningbuytotal > tblCashinternal.nNetquantity Then tblCashinternal.nNetquantity + tblCashinternal.nBuyquantity - tblCashinternal.nRunningbuytotal Else tblCashinternal.nBuyquantity End When tblCashinternal.nNetquantity < 0 Then Case When Abs(tblCashinternal.nRunningselltotal) > Abs(tblCashinternal.nNetquantity) Then tblCashinternal.nNetquantity - tblCashinternal.nBuyquantity + tblCashinternal.nRunningselltotal Else tblCashinternal.nBuyquantity * -1 End End) * tblCashinternal.nBuynetrate) as nOpStockAmount from tblCashinternal Where (tblCashinternal.nNetquantity > 0 And tblCashinternal.cBuysell = 'B' And tblCashinternal.nRunningbuytotal <= tblCashinternal.nNetquantity + tblCashinternal.nBuyquantity) or (tblCashinternal.nNetquantity < 0 and tblCashinternal.cBuysell = 'S' and Abs(tblCashinternal.nRunningselltotal) <= Abs(tblCashinternal.nNetquantity) + tblCashinternal.nBuyquantity) Group By tblCashinternal.cClientcode, tblCashinternal.cScripcode), tblCashinternal1 as (Select Sauda.Oowncode as cClientcode, Sauda.Compcode as cScripcode, Sauda.Dtoftran as dBuydate, Sauda.BuySell as cBuysell, Sum(Sauda.Quantity) as nBuyquantity, Case When Sum(Sauda.Brokpercontract) = 0 Then Avg(Sauda.Final_Rat1) Else Case When Sauda.BuySell = 'B' Then Round(((Sum(Sauda.Quantity) * Avg(Sauda.Final_Rat1)) + Sum(Sauda.Brokpercontract)) / Sum(Sauda.Quantity), 10) Else Round(((Sum(Sauda.Quantity) * Avg(Sauda.Final_Rat1)) - Sum(Sauda.Brokpercontract)) / Sum(Sauda.Quantity), 10) End End as nBuynetrate, Sum(Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, Sauda.Quantity * -1))) Over(Partition By Sauda.Oowncode, Sauda.Compcode Order By Sauda.Dtoftran, Sauda.Final_Rat1 rows between current row and unbounded following) as nRunningqty, Sum(Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, 0))) Over(Partition By Sauda.Oowncode, Sauda.Compcode Order By Sauda.Dtoftran, Sauda.Final_Rat1 rows between current row and unbounded following) as nRunningbuytotal, Sum(Sum(Decode(Sauda.Buysell, 'S', Sauda.Quantity, 0))) Over(Partition By Sauda.Oowncode, Sauda.Compcode Order By Sauda.Dtoftran, Sauda.Final_Rat1 rows between current row and unbounded following) as nRunningselltotal, Sum(Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, 0))) Over(Partition By Sauda.Oowncode, Sauda.Compcode) as nSummarybuy, Sum(Sum(Decode(Sauda.Buysell, 'S', Sauda.Quantity, 0))) Over(Partition By Sauda.Oowncode, Sauda.Compcode) as nSummarysell, Sum(Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, 0)) * Case When Sum(Sauda.Brokpercontract) = 0 Then Avg(Sauda.Final_Rat1) Else Case When Sauda.BuySell = 'B' Then Round(((Sum(Sauda.Quantity) * Avg(Sauda.Final_Rat1)) + Sum(Sauda.Brokpercontract)) / Sum(Sauda.Quantity), 10) Else 0 End End) Over(Partition By Sauda.Oowncode, Sauda.Compcode) as nSumBuyamount, Sum(Sum(Decode(Sauda.Buysell, 'S', Sauda.Quantity, 0)) * Case When Sum(Sauda.Brokpercontract) = 0 Then Avg(Sauda.Final_Rat1) Else Case When Sauda.BuySell = 'B' Then 0 Else Round(((Sum(Sauda.Quantity) * Avg(Sauda.Final_Rat1)) - Sum(Sauda.Brokpercontract)) / Sum(Sauda.Quantity), 10) End End) Over(Partition By Sauda.Oowncode, Sauda.Compcode) as nSumSellamount, Sum(Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, Sauda.Quantity * -1))) Over(Partition By Sauda.Oowncode, Sauda.Compcode) As nNetquantity From Sauda Sauda Where Sauda.Firmnumber='NBS-000001' and Sauda.Egroup!='YC' and Sauda.Egroup != 'LB' and Sauda.Egroup != 'SR' and Sauda.Egroup != 'LA' and Sauda.Sterminal != '99999' and Sauda.Dtoftran<=to_date('31/03/2024','dd/mm/yyyy') and Sauda.Brcode='341' and (Sauda.Oowncode='F2660005') group by Sauda.Oowncode, Sauda.Dtoftran, Sauda.Final_Rat1, Sauda.buysell, Sauda.Compcode), tblClosing as (Select tblCashinternal1.cClientcode as cClientcode, tblCashinternal1.cScripcode as cScripcode, Sum(Case When tblCashinternal1.nNetquantity = 0 Then 0 When tblCashinternal1.nNetquantity > 0 Then Case When tblCashinternal1.nRunningbuytotal > tblCashinternal1.nNetquantity Then tblCashinternal1.nNetquantity + tblCashinternal1.nBuyquantity - tblCashinternal1.nRunningbuytotal Else tblCashinternal1.nBuyquantity End When tblCashinternal1.nNetquantity < 0 Then Case When Abs(tblCashinternal1.nRunningselltotal) > Abs(tblCashinternal1.nNetquantity) Then tblCashinternal1.nNetquantity - tblCashinternal1.nBuyquantity + tblCashinternal1.nRunningselltotal Else tblCashinternal1.nBuyquantity * -1 End End) AS nCLStockquantity, Sum((Case When tblCashinternal1.nNetquantity = 0 Then 0 When tblCashinternal1.nNetquantity > 0 Then Case When tblCashinternal1.nRunningbuytotal > tblCashinternal1.nNetquantity Then tblCashinternal1.nNetquantity + tblCashinternal1.nBuyquantity - tblCashinternal1.nRunningbuytotal Else tblCashinternal1.nBuyquantity End When tblCashinternal1.nNetquantity < 0 Then Case When Abs(tblCashinternal1.nRunningselltotal) > Abs(tblCashinternal1.nNetquantity) Then tblCashinternal1.nNetquantity - tblCashinternal1.nBuyquantity + tblCashinternal1.nRunningselltotal Else tblCashinternal1.nBuyquantity * -1 End End) * tblCashinternal1.nBuynetrate) as nClStockAmount from tblCashinternal1 Where (tblCashinternal1.nNetquantity > 0 And tblCashinternal1.cBuysell = 'B' And tblCashinternal1.nRunningbuytotal <= tblCashinternal1.nNetquantity + tblCashinternal1.nBuyquantity) or (tblCashinternal1.nNetquantity < 0 and tblCashinternal1.cBuysell = 'S' and Abs(tblCashinternal1.nRunningselltotal) <= Abs(tblCashinternal1.nNetquantity) + tblCashinternal1.nBuyquantity) Group By tblCashinternal1.cClientcode, tblCashinternal1.cScripcode), tblBuYSell as (Select Sauda.Oowncode as cClientcode, Sauda.Compcode as cScripcode, Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, 0)) as nbuyQty, Sum(Decode(Sauda.Buysell, 'S', Sauda.Quantity, 0)) as nsellQty, Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity * Sauda.Final_Rat1 , 0)+Case When Sauda.Buysell='B' then Sauda.Brokpercontract else 0 end) as nBuyamount, Sum(Decode(Sauda.Buysell, 'S', Sauda.Quantity * Sauda.Final_Rat1 , 0)-Case When Sauda.Buysell='S' then Sauda.Brokpercontract else 0 end) as nSellamount From Sauda Sauda Where Sauda.Firmnumber='NBS-000001' and Sauda.Egroup!='YC' and Sauda.Egroup != 'LB' and Sauda.Egroup != 'SR' and Sauda.Egroup != 'LA' and Sauda.Sterminal != '99999' and Sauda.Dtoftran>=to_date('01/04/2023','dd/mm/yyyy') and Sauda.Dtoftran<=to_Date('31/03/2024','dd/mm/yyyy') and Sauda.Brcode='341' and (Sauda.Oowncode='F2660005') group by Sauda.Oowncode, Sauda.Compcode), tblCashcost as (Select Coalesce(tblOpening.cClientcode,tblClosing.cClientcode,tblBuysell.cClientcode) as cClientcode, Coalesce(tblOpening.cScripcode,tblClosing.cScripcode,tblBuysell.cScripcode) as cScripcode, Nvl(tblOpening.nOpstockquantity,0) as nOpstockquantity, Nvl(tblOpening.nOpstockamount,0) as nOpstockamount, Case When Nvl(tblOpening.nOpstockquantity,0)!=0 then Round(Nvl(tblOpening.nOpstockamount,0)/Nvl(tblOpening.nOpstockquantity,0),4) else 0 end as nOpstockavg, Nvl(tblBuysell.nBuyqty,0) as nPrePurchqty, Nvl(tblBuysell.nBuyamount,0) as nPrePurchvalue, Case When Nvl(tblBuysell.nBuyqty,0) !=0 then Round(Nvl(tblBuysell.nBuyamount,0)/Nvl(tblBuysell.nBuyqty,0),4) else 0 end as nPrePurchavg, Nvl(tblBuysell.nSellQty, 0) as nPreSellqty, Nvl(tblBuysell.nSellamount, 0) as nPreSellvalue, Case When Nvl(tblBuysell.nSellQty, 0) != 0 then Round(Nvl(tblBuysell.nSellamount, 0) / Nvl(tblBuysell.nSellQty, 0), 4) else 0 end as nPreSellavg, Least((Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockquantity, 0) + Nvl(tblBuysell.nBuyqty, 0) Else Nvl(tblBuysell.nBuyqty, 0) End), (Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockquantity, 0)) + Nvl(tblBuysell.nSellqty, 0) Else Nvl(tblBuysell.nSellqty, 0) End)) as nPurchqty, Round((Case When (Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockquantity, 0) + Nvl(tblBuysell.nBuyqty, 0) Else Nvl(tblBuysell.nBuyqty, 0) End) <= (Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockquantity, 0)) + Nvl(tblBuysell.nSellqty, 0) Else Nvl(tblBuysell.nSellqty, 0) End) Then Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockAmount, 0) + Nvl(tblBuysell.nBuyAmount, 0) Else Nvl(tblBuysell.nBuyAmount, 0) End Else Nvl(tblBuysell.nBuyAmount, 0) + Nvl(tblOpening.nOpstockAmount, 0) - nvl(tblClosing.nClStockAmount, 0) End), 2) as nPurchvalue, Round((Case When Least((Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockquantity, 0) + Nvl(tblBuysell.nBuyqty, 0) Else Nvl(tblBuysell.nBuyqty, 0) End), (Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockquantity, 0)) + Nvl(tblBuysell.nSellqty, 0) Else Nvl(tblBuysell.nSellqty, 0) End)) != 0 Then (Case When (Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockquantity, 0) + Nvl(tblBuysell.nBuyqty, 0) Else Nvl(tblBuysell.nBuyqty, 0) End) <= (Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockquantity, 0)) + Nvl(tblBuysell.nSellqty, 0) Else Nvl(tblBuysell.nSellqty, 0) End) Then Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockAmount, 0) + Nvl(tblBuysell.nBuyAmount, 0) Else Nvl(tblBuysell.nBuyAmount, 0) End Else Nvl(tblBuysell.nBuyAmount, 0) + Nvl(tblOpening.nOpstockAmount, 0) - nvl(tblClosing.nClStockAmount, 0) End) / (Least((Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockquantity, 0) + Nvl(tblBuysell.nBuyqty, 0) Else Nvl(tblBuysell.nBuyqty, 0) End), (Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockquantity, 0)) + Nvl(tblBuysell.nSellqty, 0) Else Nvl(tblBuysell.nSellqty, 0) End))) Else 0 End), 4) as nPurchavg, Least((Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockquantity, 0) + Nvl(tblBuysell.nBuyqty, 0) Else Nvl(tblBuysell.nBuyqty, 0) End), (Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockquantity, 0)) + Nvl(tblBuysell.nSellqty, 0) Else Nvl(tblBuysell.nSellqty, 0) End)) as nSalesqty, Round((Case When (Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockquantity, 0) + Nvl(tblBuysell.nBuyqty, 0) Else Nvl(tblBuysell.nBuyqty, 0) End) >= (Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockquantity, 0)) + Nvl(tblBuysell.nSellqty, 0) Else Nvl(tblBuysell.nSellqty, 0) End) Then Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockAmount, 0)) + Nvl(tblBuysell.nSellAmount, 0) Else Nvl(tblBuysell.nSellAmount, 0) End Else Nvl(tblBuysell.nSellAmount, 0) - Nvl(tblOpening.nOpstockAmount, 0) + nvl(tblClosing.nClStockAmount, 0) End), 2) as nSalesvalue, Round((Case When Least((Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockquantity, 0) + Nvl(tblBuysell.nBuyqty, 0) Else Nvl(tblBuysell.nBuyqty, 0) End), (Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockquantity, 0)) + Nvl(tblBuysell.nSellqty, 0) Else Nvl(tblBuysell.nSellqty, 0) End)) != 0 Then (Case When (Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockquantity, 0) + Nvl(tblBuysell.nBuyqty, 0) Else Nvl(tblBuysell.nBuyqty, 0) End) >= (Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockquantity, 0)) + Nvl(tblBuysell.nSellqty, 0) Else Nvl(tblBuysell.nSellqty, 0) End) Then Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockAmount, 0)) + Nvl(tblBuysell.nSellAmount, 0) Else Nvl(tblBuysell.nSellAmount, 0) End Else Nvl(tblBuysell.nSellAmount, 0) - Nvl(tblOpening.nOpstockAmount, 0) + nvl(tblClosing.nClStockAmount, 0) End) / (Least((Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockquantity, 0) + Nvl(tblBuysell.nBuyqty, 0) Else Nvl(tblBuysell.nBuyqty, 0) End), (Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockquantity, 0)) + Nvl(tblBuysell.nSellqty, 0) Else Nvl(tblBuysell.nSellqty, 0) End))) ELse 0 End), 4) as nSalesavg, Nvl(tblClosing.nClstockquantity, 0) as nOsstock, Nvl(tblClosing.nClstockamount, 0) as nOsstockvalue, Case When Nvl(tblClosing.nClstockquantity, 0) != 0 then Round(Nvl(tblClosing.nClstockamount, 0) / Nvl(tblClosing.nClstockquantity, 0), 4) else 0 end as nOsstockavg, (nvl(tblBuySell.nSellAmount, 0) - nvl(tblOpening.nOpStockAmount, 0) - nvl(tblBuySell.nBuyAmount, 0) + nvl(tblClosing.nClStockAmount, 0)) as nProfitloss, ((Market.Market * nvl(tblClosing.nClstockquantity, 0)) - Nvl(tblClosing.nClstockamount, 0)) As nUnrealprlo, (nvl(tblBuySell.nSellAmount, 0) - nvl(tblOpening.nOpStockAmount, 0) - nvl(tblBuySell.nBuyAmount, 0) + nvl(tblClosing.nClStockAmount, 0)) + ((Market.Market * nvl(tblClosing.nClstockquantity, 0)) - Nvl(tblClosing.nClstockamount, 0)) As nOverallprlo, Market.Market as nMarketrate, Market.Market*Nvl(tblClosing.nClstockquantity,0) As nMarketvalue from tblOPening tblOpening Full Join TblClosing on tblOpening.cclientcode = tblclosing.cclientcode and tblOPening.cScripcode = tblClosing.cScripcode Full Join TblBuySell on tblBuySell.cclientcode = coalesce(tblOpening.cclientcode, tblclosing.cclientcode) and tblBuySell.cScripcode = coalesce(tblOPening.cScripcode, tblClosing.cScripcode) Left Outer Join Market Market On Market.Firmnumber='NBS-000001' and Market.code=coalesce(tblOpening.cScripcode, tblclosing.cScripcode, tblBuysell.cScripcode) ), tblOpendet as (Select Ledger.Oowncode as cClientcode, '01' as cRowindicator, Sum(Ledger.Damount-Ledger.Camount)*-1 as nSecamount From Ledger Ledger Where Ledger.Firmnumber='NBS-000001' and Ledger.nFinancialyear = 2024 and (Ledger.Oowncode='F2660005') and Ledger.Branchcode='341' and Substr(Ledger.Voucher,1,4)='OPNG' group by Ledger.Oowncode Union All Select tblCashcost.cClientcode as cClientcode, '01' as cRowindicator, Sum(tblCashcost.nOpstockamount) as nSecamount From tblCashcost tblCashcost group by tblCashcost.cClientcode ), tblOpenstk as (Select tblOpendet.cClientcode as cClientcode, Max(tblOpendet.cRowindicator) as cRowindicator, 0 as nFiramount, Sum(tblOpendet.nSecamount) as nSecamount From tblOpendet tblOpendet group by tblOpendet.cClientcode), tblPortcashfin as (Select tblCashcost.cClientcode as cClientcode, '04' as cRowindicator, Sum(tblCashcost.nProfitloss) as nFiramount, 0 as nSecamount From tblCashcost tblCashcost group by tblCashcost.cClientcode Union All Select tblCashcost.cClientcode as cClientcode, '25' as cRowindicator, Sum(tblCashcost.nMarketvalue) as nFiramount, 0 as nSecamount From tblCashcost tblCashcost group by tblCashcost.cClientcode Union All Select tblCashcost.cClientcode as cClientcode, '08' as cRowindicator, Sum(tblCashcost.nUnrealprlo) as nFiramount, 0 as nSecamount From tblCashcost tblCashcost group by tblCashcost.cClientcode ), tblFointernal as (Select Fosauda.Oowncode as cClientcode, Fosauda.Compcode as cScripcode, Fosauda.Strikeprice as nStrikeprice, Fosauda.Optiontype as cOptiontype, Company.Fibsacct as cScripname, Company.Expirydate as dExpirydate, Exchange.Operation as cOperation, Company.Instrutyp as cInstrutyp, Company.nBaseunit as nBaseunit, Company.cUnitofmeasurement as cUnitofmeasurement, Company.cUnitofTrading as cUnitofTrading, Company.nTradeablelot as nTradeablelot, Company.nPricenumerator as nPricenumerator, Company.nPricedenominator as nPricedenominator, Company.nGeneralnumerator as nGeneralnumerator, Company.nGeneraldenominator as nGeneraldenominator, Fosauda.Dtoftran as dBuydate, Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') or Fosauda.Optiontype != 'PO' Then Fosauda.Buysell else Case When Fosauda.Buysell = 'B' Then 'S' Else 'B' End end as cBuysell, Sum(Fosauda.quantity) as nBuyquantity, Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') Then Case When Sum(Fosauda.nValuebrokerage) = 0 then Avg(Fosauda.Final_Rat1) else Case When Fosauda.BuySell = 'B' Then Round(((Sum(Fosauda.Quantity) * Avg(Fosauda.Final_Rat1)) + Sum(Fosauda.nValuebrokerage)) / Sum(Fosauda.Quantity), 10) Else Round(((Sum(Fosauda.Quantity) * Avg(Fosauda.Final_Rat1)) - Sum(Fosauda.nValuebrokerage)) / Sum(Fosauda.Quantity), 10) End End Else Case When Fosauda.Buysell = 'B' Then Avg(Fosauda.Final_rat1) - Avg(Fosauda.Strikeprice) else Avg(Fosauda.Strikeprice) - Avg(Fosauda.Final_rat1) End End as nBuynetrate, Sum(Sum(Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') or Fosauda.Optiontype != 'PO' Then Decode(Fosauda.Buysell, 'B', Fosauda.Quantity, Fosauda.Quantity * -1) Else Decode(Fosauda.Buysell, 'S', Fosauda.Quantity, Fosauda.Quantity * -1) End)) Over(Partition By Fosauda.Oowncode, Company.Fibsacct, Fosauda.Strikeprice, Fosauda.Optiontype Order By Fosauda.Dtoftran, Fosauda.Final_Rat1 rows between current row and unbounded following) as nRunningqty, Sum(Sum(Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') or Fosauda.optiontype != 'PO' Then Decode(Fosauda.Buysell, 'B', Fosauda.Quantity, 0) Else Decode(Fosauda.Buysell, 'S', Fosauda.Quantity, 0) End)) Over(Partition By Fosauda.Oowncode, Company.Fibsacct, Fosauda.Strikeprice, Fosauda.Optiontype Order By Fosauda.Dtoftran, Fosauda.Final_Rat1 rows between current row and unbounded following) as nRunningbuytotal, Sum(Sum(Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') or Fosauda.Optiontype != 'PO' Then Decode(Fosauda.Buysell, 'S', Fosauda.Quantity, 0) Else Decode(Fosauda.Buysell, 'B', Fosauda.Quantity, 0) End)) Over(Partition By Fosauda.Oowncode, Company.Fibsacct, Fosauda.Strikeprice, Fosauda.Optiontype Order By Fosauda.Dtoftran, Fosauda.Final_Rat1 rows between current row and unbounded following) as nRunningselltotal, Sum(Sum(Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') or Fosauda.optiontype != 'PO' Then Decode(Fosauda.Buysell, 'B', Fosauda.Quantity, 0) Else Decode(Fosauda.Buysell, 'S', Fosauda.Quantity, 0) End)) Over(Partition By Fosauda.Oowncode, Company.Fibsacct, Fosauda.Strikeprice, Fosauda.Optiontype) as nSummarybuy, Sum(Sum(Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') or Fosauda.optiontype != 'PO' Then Decode(Fosauda.Buysell, 'S', Fosauda.Quantity, 0) Else Decode(Fosauda.Buysell, 'B', Fosauda.Quantity, 0) End)) Over(Partition By Fosauda.Oowncode, Company.Fibsacct, Fosauda.Strikeprice, Fosauda.Optiontype) as nSummarysell, Sum(Sum(Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') or Fosauda.Optiontype != 'PO' Then Decode(Fosauda.Buysell, 'B', Fosauda.Quantity, 0) Else Decode(Fosauda.Buysell, 'S', Fosauda.Quantity, 0) End) * Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') Then Case When Sum(Fosauda.nValuebrokerage) = 0 then Avg(Fosauda.Final_Rat1) else Case When Fosauda.BuySell = 'B' Then Round(((Sum(Fosauda.Quantity) * Avg(Fosauda.Final_Rat1)) + Sum(Fosauda.nValuebrokerage)) / Sum(Fosauda.Quantity), 10) Else Round(((Sum(Fosauda.Quantity) * Avg(Fosauda.Final_Rat1)) - Sum(Fosauda.nValuebrokerage)) / Sum(Fosauda.Quantity), 10) End End Else Abs(Avg(Fosauda.Final_Rat1) - Avg(fosauda.strikeprice)) End) Over(Partition By Fosauda.Oowncode, Company.Fibsacct, Fosauda.Strikeprice, Fosauda.Optiontype) as nSumBuyamount, Sum(Sum(Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') or Fosauda.Optiontype != 'PO' Then Decode(Fosauda.Buysell, 'S', Fosauda.Quantity, 0) Else Decode(Fosauda.Buysell, 'B', Fosauda.Quantity, 0) End) * Case When (Fosauda.saudatype != 'AS' and Fosauda.Saudatype != 'EX') Then Case When Sum(Fosauda.nValuebrokerage) = 0 then Avg(Fosauda.Final_Rat1) else Case When Fosauda.BuySell = 'B' Then Round(((Sum(Fosauda.Quantity) * Avg(Fosauda.Final_Rat1)) + Sum(Fosauda.nValuebrokerage)) / Sum(Fosauda.Quantity), 10) Else Round(((Sum(Fosauda.Quantity) * Avg(Fosauda.Final_Rat1)) - Sum(Fosauda.nValuebrokerage)) / Sum(Fosauda.Quantity), 10) End End Else Abs(Avg(Fosauda.Final_Rat1) - Avg(fosauda.strikeprice)) End) Over(Partition By Fosauda.Oowncode, Company.Fibsacct, Fosauda.Strikeprice, Fosauda.Optiontype) as nSumSellamount, Sum(Sum(Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') or Fosauda.optiontype != 'PO' Then Decode(Fosauda.Buysell, 'B', Fosauda.Quantity, Fosauda.Quantity * -1) Else Decode(Fosauda.Buysell, 'S', Fosauda.Quantity, Fosauda.Quantity * -1) End)) Over(Partition By Fosauda.Oowncode, Company.Fibsacct, Fosauda.Strikeprice, Fosauda.Optiontype) As nNetquantity From Fosauda Fosauda Inner Join Company Company On Fosauda.firmnumber = Company.Firmnumber and Fosauda.Compcode = Company.oowncode Inner Join Exchange Exchange On Fosauda.Firmnumber = Exchange.Firmnumber and Fosauda.Exchcode = Exchange.Code Where Fosauda.Firmnumber = 'NBS-000001' and Fosauda.Egroup != 'YF' and Fosauda.Egroup != 'LB' and Fosauda.Egroup != 'SR' and Fosauda.Egroup != 'LA' and Fosauda.Sterminal != '99999' and (Fosauda.Oowncode='F2660005') and Fosauda.Brcode='341' and Fosauda.Dtoftran>=to_date('01/04/2023','dd/mm/yyyy') and Fosauda.Dtoftran<=to_date('31/03/2024','dd/mm/yyyy') and ((Fosauda.Saudatype != 'B/' and Fosauda.Orignalno = 0) or (Fosauda.Saudatype = 'B/' and (Fosauda.Orignalno = -99 or Fosauda.Dtoftran=to_date('01/04/2023','dd/mm/yyyy')))) group by Fosauda.Oowncode, Company.Fibsacct, Company.Expirydate, Exchange.Operation, Company.Instrutyp, Company.nBaseunit, Company.cUnitofmeasurement, Company.cUnitofTrading, Company.nTradeablelot, Company.nPricenumerator, Company.nPricedenominator, Company.nGeneralnumerator, Company.nGeneraldenominator, Fosauda.Dtoftran, Fosauda.Final_Rat1, Fosauda.buysell, Fosauda.Compcode, Fosauda.Strikeprice, Fosauda.Saudatype, Fosauda.Optiontype), tblFocost as (Select tblFointernal.cClientcode as cClientcode, tblFointernal.cScripcode as cScripcode, tblFointernal.nStrikeprice as nStrikeprice, tblFointernal.cOptiontype as cOptiontype, tblFointernal.cScripname as cScripname, tblFointernal.cOperation as cOperation, tblFoInternal.cInstrutyp as cInstrutyp, tblFoInternal.nBaseunit as nBaseunit, tblFoInternal.cUnitofmeasurement as cUnitofmeasurement, tblFoInternal.cUnitofTrading as cUnitofTrading, tblFoInternal.nTradeablelot as nTradeablelot, tblFoInternal.nPricenumerator as nPricenumerator, tblFoInternal.nPricedenominator as nPricedenominator, tblFoInternal.nGeneralnumerator as nGeneralnumerator, tblFoInternal.nGeneraldenominator as nGeneraldenominator, tblFointernal.dExpirydate as dExpirydate, tblFointernal.dBuydate as dBuydate, tblFointernal.nBuynetrate as nBuynetrate, Case When tblFointernal.nNetquantity = 0 Then 0 When tblFointernal.nNetquantity > 0 Then Case When tblFointernal.nRunningbuytotal > tblFointernal.nNetquantity Then tblFointernal.nNetquantity + tblFointernal.nBuyquantity - tblFointernal.nRunningbuytotal Else tblFointernal.nBuyquantity End When tblFointernal.nNetquantity < 0 Then Case When abs(tblFointernal.nRunningselltotal) > abs(tblFointernal.nNetquantity) Then tblFointernal.nNetquantity - tblFointernal.nBuyquantity + tblFointernal.nRunningselltotal Else tblFointernal.nBuyquantity * -1 End End AS nStockquantity, tblFointernal.nSummarybuy as nSummarybuy, tblFointernal.nSumBuyamount as nSumbuyamount, tblFointernal.nSummarysell as nSummarysell, tblFointernal.nSumSellamount as nSumsellamount From tblFointernal tblFoInternal Where (tblFointernal.nNetquantity > 0 and tblFointernal.cBuysell = 'B' and tblFointernal.nRunningbuytotal <= tblFointernal.nNetquantity + tblFointernal.nBuyquantity) or (tblFointernal.nNetquantity < 0 and tblFointernal.cBuysell = 'S' and abs(tblFointernal.nRunningselltotal) <= Abs(tblFointernal.nNetquantity) + tblFointernal.nBuyquantity) or (tblFointernal.nNetquantity = 0 And tblFointernal.nRunningselltotal = tblFointernal.nSummarysell and tblFointernal.nRunningbuytotal = tblFointernal.nSummarybuy)), tblFinalcost as (Select tblFocost.cClientcode as cClientcode, tblFocost.cScripcode as cScripcode, tblFocost.nStrikeprice as nStrikeprice, tblFocost.cOptiontype as cOptiontype, tblFocost.dExpirydate as dExpirydate, tblFocost.cScripname as cScripname, tblFocost.cOperation as cOperation, tblFocost.cInstrutyp as cInstrutyp, tblFocost.nBaseunit as nBaseunit, tblFocost.cUnitofmeasurement as cUnitofmeasurement, tblFocost.cUnitofTrading as cUnitofTrading, tblFocost.nTradeablelot as nTradeablelot, tblFocost.nPricenumerator as nPricenumerator, tblFocost.nPricedenominator as nPricedenominator, tblFocost.nGeneralnumerator as nGeneralnumerator, tblFocost.nGeneraldenominator as nGeneraldenominator, tblFocost.nSummarybuy - (Case When Sum(tblFocost.nStockquantity) > 0 then Sum(tblFocost.nStockquantity) else 0 end) As nPurchqty, tblFocost.nSumbuyamount - (Case When Sum(tblFocost.nStockquantity) > 0 then Sum(tblFocost.nStockquantity * tblFocost.nBuyNetRate) else 0 end) As nPurchvalue, tblFocost.nSummarysell - (Case When Sum(tblFocost.nStockquantity) < 0 then Sum(Abs(tblFocost.nStockquantity)) else 0 end) as nSalesqty, tblFocost.nSumSellamount - (Case When Sum(tblFocost.nStockquantity) < 0 then Sum(Abs(tblFocost.nStockquantity) * tblFocost.nBuyNetRate) else 0 end) as nSalesvalue, Sum(tblFocost.nStockquantity) As nOsstock, Case When Sum(tblFocost.nStockquantity) != 0 then Round(Sum(tblFocost.nStockquantity * tblFocost.nBuyNetRate) / Sum(tblFocost.nStockquantity), 4) else 0 end as nOsstockavg, Sum(tblFocost.nStockquantity * tblFocost.nBuyNetRate) as nOsstockvalue, tblFocost.nSumSellamount + Sum(tblFocost.nStockquantity * tblFocost.nBuyNetRate) - tblFocost.nSumBuyamount as nProfitLoss, Max(Market.Market) as nMarketrate, Max(Market.Market) * Sum(tblFocost.nStockquantity) as nMarketvalue, ((tblFocost.nSumSellamount + Sum(tblFocost.nStockquantity * tblFocost.nBuyNetRate) - tblFocost.nSumBuyamount)) + ((Max(Market.Market) * Sum(tblFocost.nStockquantity)) - (Sum(tblFocost.nStockquantity * tblFocost.nBuyNetRate))) as nOverallprlo, Max(Market.nPrvcloseprice) as nPrvcloseprice, Max(Market.nHighprice) as nHighprice, Max(Market.nLowprice) as nLowprice, Max(Market.nLowercircuitLimit) as nLowercircuitlimit, Max(Market.nOpenprice) as nOpenprice, Max(Market.nUppercircuitlimit) as nUppercircuitlimit, Max(Market.nNoofTrades) as nNooftrades, Max(Market.nVoltradedToday) as nVoltradedtoday, Max(Market.nVolquantity) as nVolquantity, Max(Market.dLastupdatedate) as dlastupdatedate, Max(Market.n52Weeklow) as n52Weeklow, Max(Market.n52WeekHigh) as n52Weekhigh From tblFocost tblFocost Left Outer Join Market Market On Market.Firmnumber = 'NBS-000001' and tblFocost.cScripcode = Market.Code and tblFocost.nStrikeprice = Market.Strikeprice and tblFocost.cOptiontype = Market.Optiontype and ((Market.nOptmethod = 0 and tblFocost.nStrikeprice = 0) or (Market.nOptmethod = 1 and tblFocost.nStrikeprice != 0)) Group By tblFocost.cClientcode, tblFocost.cScripcode, tblFocost.cScripname, tblFocost.cOperation, tblFocost.cInstrutyp, tblFocost.nBaseunit, tblFocost.cUnitofmeasurement, tblFocost.cUnitofTrading, tblFocost.nTradeablelot, tblFocost.nPricenumerator, tblFocost.nPricedenominator, tblFocost.nGeneralnumerator, tblFocost.nGeneraldenominator, tblFocost.dExpirydate, tblFocost.nStrikeprice, tblFocost.cOptiontype, tblFocost.nSummarybuy, tblFocost.nSumBuyamount, tblFocost.nSummarysell, tblFocost.nSumSellamount), tblPortderfinal as (Select tblFinalcost.cClientcode as cClientcode, tblFinalcost.cScripcode as cScripcode, tblFinalcost.cScripname as cScripname, tblFinalcost.cOperation as cOperation, tblFinalcost.cInstrutyp as cInstrutyp, tblFinalcost.nBaseunit as nBaseunit, tblFinalcost.cUnitofmeasurement as cUnitofmeasurement, tblFinalcost.cUnitofTrading as cUnitofTrading, tblFinalcost.nTradeablelot as nTradeablelot, tblFinalcost.nPricenumerator as nPricenumerator, tblFinalcost.nPricedenominator as nPricedenominator, tblFinalcost.nGeneralnumerator as nGeneralnumerator, tblFinalcost.nGeneraldenominator as nGeneraldenominator, tblFinalcost.nStrikeprice as nStrikeprice, tblFinalcost.cOptiontype as cOptiontype, tblFinalcost.dExpirydate as dExpirydate, tblFinalcost.nPurchqty As nPurchqty, tblFinalcost.nPurchvalue As nPurchvalue, Round(Case When tblFinalcost.nPurchqty != 0 then tblFinalcost.nPurchvalue / tblFinalcost.nPurchqty else 0 End, 4) As nPurchavg, tblFinalcost.nSalesqty as nSalesqty, tblFinalcost.nSalesvalue as nSalesvalue, Round(Case When tblFinalcost.nSalesqty != 0 then tblFinalcost.nSalesvalue / tblFinalcost.nSalesqty else 0 end, 4) as nSalesavg, tblFinalcost.nOsstock As nOsstock, tblFinalcost.nOsstockavg as nOsstockavg, tblFinalcost.nOsstockvalue as nOsstockvalue, tblFinalcost.nMarketrate as nMarketrate, tblFinalcost.nMarketvalue as nMarketvalue, ((tblFinalcost.nMarketrate * tblFinalcost.nOsstock) - (tblFinalcost.nOsstock * tblFinalcost.nOsstockavg)) as nUnrealprlo, tblFinalcost.nProfitloss as nProfitLoss, tblFinalcost.nOverallprlo as nOverallprlo, tblFinalcost.nPrvcloseprice as nPrvcloseprice, tblFinalcost.nHighprice as nHighprice, tblFinalcost.nLowprice as nLowprice, tblFinalcost.nLowercircuitLimit as nLowercircuitlimit, tblFinalcost.nOpenprice as nOpenprice, tblFinalcost.nUppercircuitlimit as nUppercircuitlimit, tblFinalcost.nNooftrades as nNooftrades, tblFinalcost.nVoltradedtoday as nVoltradedtoday, tblFinalcost.nVolquantity as nVolquantity, tblFinalcost.dLastupdatedate as dlastupdatedate, tblFinalcost.n52WeekLow as n52Weeklow, tblFinalcost.n52Weekhigh as n52Weekhigh From tblFinalcost tblFinalcost Order by tblFinalcost.cClientcode, tblFinalcost.cScripname, tblFinalcost.nStrikeprice, tblFinalcost.cOptiontype, tblFinalcost.dExpirydate ), tblPortderfin as (Select tblPortderfinal.cClientcode as cClientcode, '05' as cRowindicator, Sum(tblPortderfinal.nProfitloss) as nFiramount, 0 as nSecamount From tblPortderfinal tblPortderfinal group by tblPortderfinal.cClientcode Union All Select tblPortderfinal.cClientcode as cClientcode, '09' as cRowindicator, Sum(tblPortderfinal.nUnrealprlo) as nFiramount, 0 as nSecamount From tblPortderfinal tblPortderfinal group by tblPortderfinal.cClientcode), tblCashplusderfinal as (Select Coalesce(tblPortcashfin.cClientcode,tblPortderfin.cClientcode) as cClientcode, Case When Coalesce(tblPortcashfin.cRowindicator,tblPortderfin.cRowindicator)='04' or Coalesce(tblPortcashfin.cRowindicator,tblPortderfin.cRowindicator)='05' then '06' else '10' end as cRowindicator, 0 as nFiramount, Sum(Coalesce(tblPortcashfin.nFiramount,tblPortderfin.nFiramount,0)) as nSecamount From tblPortcashfin Full outer join tblPortderfin On tblPortcashfin.cClientcode=tblPortderfin.cClientcode and tblPortcashfin.cRowindicator=tblPortderfin.cRowindicator Where tblPortcashfin.cRowindicator='04' or tblPortcashfin.cRowindicator='08' or tblPortderfin.cRowindicator='05' or tblPortderfin.cRowindicator='09' group by Coalesce(tblPortcashfin.cClientcode,tblPortderfin.cClientcode) , Case When Coalesce(tblPortcashfin.cRowindicator,tblPortderfin.cRowindicator)='04' or Coalesce(tblPortcashfin.cRowindicator,tblPortderfin.cRowindicator)='05' then '06' else '10' end ), tblDividend as (Select Ledger.Oowncode as cClientcode, '11' as cRowindicator, 0 as nFiramount, Sum(Ledger.damount-Ledger.Camount)*-1 as nSecamount From Ledger Ledger Inner Join Journal On Ledger.Firmnumber=Journal.Firmnumber and Ledger.Voucher=Journal.Jvnumber and Ledger.nFinancialyear=Journal.nFinancialyear Where Ledger.Firmnumber='NBS-000001' and Ledger.nFinancialyear=2024 and (Ledger.Oowncode='F2660005') and Ledger.Branchcode='341' and Ledger.Dtoftran>=to_date('01/04/2023','dd/mm/yyyy') and Ledger.Dtoftran<=to_date('31/03/2024','dd/mm/yyyy') and Journal.nEntrytype=1 group by Ledger.Oowncode ), tblDirectDividend as (Select tblDirectdiv.cClientcode as cClientcode, '16' as cRowindicator, 0 as nFiramount, Sum(tblDirectdiv.nQuantity*tblDirectdiv.nRate)*-1 as nSecamount From tblDirectdiv tblDirectdiv Inner Join Ldfibs Ldfibs On tblDirectdiv.cFirmnumber = Ldfibs.Firmnumber and tblDirectdiv.cClientcode = Ldfibs.Oowncode Where tblDirectdiv.cFirmnumber='NBS-000001' and (tblDirectdiv.cClientcode='F2660005') and tblDirectdiv.dDtoftran>=to_date('01/04/2023','dd/mm/yyyy') and tblDirectdiv.dDtoftran<=to_date('31/03/2024','dd/mm/yyyy') group by tblDirectdiv.cClientcode ), tbltmpBillcharges as (Select Billcharges.Oowncode as cClientcode, Case When Billcharges.Egroup='FU' then '14' else '13' end as cRowindicator, Sum(Billcharges.Quantity*Billcharges.Final_Rat1) as nFiramount, 0 as nSecamount From Billcharges Billcharges Where Billcharges.Firmnumber='NBS-000001' and Billcharges.Brcode='341' and (Billcharges.Oowncode='F2660005') and Billcharges.Dtoftran>=to_date('01/04/2023','dd/mm/yyyy') and Billcharges.Dtoftran<=to_date('31/03/2024','dd/mm/yyyy') group by Billcharges.Oowncode, Case When Billcharges.Egroup='FU' then '14' else '13' end ), tbltmpbillchgtotal as (Select tbltmpBillcharges.cClientcode as cClientcode, '12' as cRowindicator, 0 as nFiramount, Sum(tbltmpBillcharges.nFiramount) as nSecamount from tbltmpBillcharges tbltmpBillcharges group by tbltmpbillcharges.cClientcode ), tblMiscentries as ( Select Ledger.Oowncode as cClientcode, '15' as cRowindicator, 0 as nFiramount, Sum(Ledger.damount-Ledger.Camount)*-1 as nSecamount From Ledger Ledger Inner Join Journal On Ledger.Firmnumber=Journal.Firmnumber and Ledger.Voucher=Journal.Jvnumber and Ledger.nFinancialyear=Journal.nFinancialyear Where Ledger.Firmnumber='NBS-000001' and Ledger.nFinancialyear=2024 and (Ledger.Oowncode='F2660005') and Ledger.Branchcode='341' and Ledger.Dtoftran>=to_date('01/04/2023','dd/mm/yyyy') and Ledger.Dtoftran<=to_date('31/03/2024','dd/mm/yyyy') and Journal.nEntrytype!=1 group by Ledger.Oowncode ), tbltempportalloc as (Select Coalesce(tblFinledger.cClientcode,tblPortcashfin.cClientcode) as cClientcode, '27' as cRowindicator, Sum(Nvl(tblFinledger.nFiramount,0)+Nvl(tblPortcashfin.nFiramount,0)) as nFiramount, 0 as nSecamount From tblFinledger tblFinledger Full Outer Join tblPortcashfin On tblFinledger.cClientcode=tblPortcashfin.cClientcode and tblFinledger.cRowindicator=tblPortcashfin.cRowindicator Where (tblFinledger.cRowindicator='26' or tblPortcashfin.cRowindicator='25') group by Coalesce(tblFinledger.cClientcode,tblPortcashfin.cClientcode) ), tbltemptotdays as (Select '18' as cRowindicator, (to_date('31/03/2024','dd/mm/yyyy') - to_date('01/04/2024','dd/mm/yyyy'))+1 as nSecamount From dual ), tblFinalloop as (Select tblReportdesc.cRowindicator as cRowindicator, tblReportdesc.cRowdesc as cRowdesc, Coalesce(tblReportdesc.cClientcode,tblOpenstk.cClientcode,tblCapinout.cClientcode,tblPortcashfin.cClientcode,tblPortderfin.cClientcode,tblCashplusderfinal.cClientcode,tblDividend.cClientcode,tbltmpbillcharges.cClientcode,tbltmpbillchgtotal.cClientcode,tblMiscentries.cClientcode,tblFinledger.cClientcode,tbltempPortalloc.cClientcode,tblDirectdividend.cClientcode) as cClientcode, Coalesce(tblOpenstk.nFiramount,tblCapinout.nFiramount,tblPortcashfin.nFiramount,tblPortderfin.nFiramount,tblCashplusderfinal.nFiramount,tblDividend.nFiramount,tbltmpBillcharges.nFiramount,tbltmpbillchgtotal.nFiramount,tblMiscentries.nFiramount,tblFinledger.nFiramount,tbltempPortalloc.nFiramount,tblDirectdividend.nFiramount) as nFiramount, Coalesce(tblOpenstk.nSecamount,tblCapinout.nSecamount,tblPortcashfin.nSecamount,tblPortderfin.nSecamount,tblCashplusderfinal.nSecamount,tblDividend.nSecamount,tbltmpBillcharges.nSecamount,tbltmpBillchgtotal.nSecamount,tblMiscentries.nSecamount,tblFinledger.nSecamount,tbltempPortalloc.nSecamount,tbltempTotdays.nSecamount,tbltempTotdays.nSecamount) as nSecamount From tblReportdesc tblReportdesc Left Outer Join tblOpenstk On tblReportdesc.cRowindicator=tblOpenstk.cRowindicator and tblReportdesc.cClientcode=tblOpenstk.cClientcode Left Outer Join tblCapinout On tblReportdesc.cRowindicator=tblCapinout.cRowindicator and tblReportdesc.cClientcode=tblCapinout.cClientcode Left Outer Join tblPortcashfin On tblReportdesc.cRowindicator=tblPortcashfin.cRowindicator and tblReportdesc.cClientcode=tblPortcashfin.cClientcode Left Outer Join tblPortderfin On tblReportdesc.cRowindicator=tblPortderfin.cRowindicator and tblReportdesc.cClientcode=tblPortderfin.cClientcode Left Outer Join tblCashplusderfinal On tblReportdesc.cRowindicator=tblCashplusderfinal.cRowindicator and tblReportdesc.cClientcode=tblCashplusderfinal.cClientcode Left Outer Join tblDividend On tblReportdesc.cRowindicator=tblDividend.cRowindicator and tblReportdesc.cClientcode=tblDividend.cClientcode Left Outer Join tbltmpBillcharges On tblReportdesc.cRowindicator=tbltmpBillcharges.cRowindicator and tblReportdesc.cClientcode=tbltmpBillcharges.cClientcode Left Outer Join tbltmpbillchgtotal On tblReportdesc.cRowindicator=tbltmpBillchgtotal.cRowindicator and tblReportdesc.cClientcode=tbltmpBillchgtotal.cClientcode Left Outer Join tblMiscentries On tblReportdesc.cRowindicator=tblMiscentries.cRowindicator and tblReportdesc.cClientcode=tblMiscentries.cClientcode Left Outer Join tblFinledger On tblReportdesc.cRowindicator=tblFinledger.cRowindicator and tblReportdesc.cClientcode=tblFinledger.cClientcode Left Outer Join tbltempPortalloc On tblReportdesc.cRowindicator=tbltempPortalloc.cRowindicator and tblReportdesc.cClientcode=tbltempPortalloc.cClientcode Left Outer Join tblDirectdividend On tblReportdesc.cRowindicator=tblDirectdividend.cRowindicator and tblReportdesc.cClientcode=tblDirectdividend.cClientcode Left Outer Join tbltemptotdays On tblReportdesc.cRowindicator=tbltempTotdays.cRowindicator ), tbltempporttotal as ( Select '17' as cRowindicator, tblFinalloop.cClientcode as cClientcode, Sum(tblFinalloop.nSecamount) as nTotalamount From tblFinalloop Where tblFinalloop.cRowindicator!='18' and nvl(trim(tblFinalloop.cClientcode),' ')!=' ' group by tblFinalloop.cClientcode ), tbltemptotalcapital as ( Select tblFinalloop.cClientcode as cClientcode, Sum(tblFinalloop.nSecamount) as nTotalamount From tblFinalloop tblFinalloop Where (tblFinalloop.cRowindicator='02' or tblFinalloop.cRowindicator='01') and nvl(trim(tblFinalloop.cClientcode),' ')!=' ' group by tblFinalloop.cClientcode ) Select tblFinalloop.cRowindicator as cRowindicator, tblFinalloop.cRowdesc as cRowdesc, tblFinalloop.cClientcode as cClientcode, tblFinalloop.nFiramount as nFiramount, Case When (tblFinalloop.cRowindicator=25 or tblFinalloop.cRowindicator=26) and tbltempPortalloc.nFiramount!=0 then Round(tblFinalloop.nFiramount/tbltempPortalloc.nFiramount*100,2) When tblFInalloop.cRowindicator='17' then tbltempporttotal.nTotalamount When tblFinalloop.cRowindicator='19' and tbltemptotalcapital.nTotalamount!=0 then Round((tbltempporttotal.nTotalamount-tbltemptotalcapital.nTotalamount)*100/tbltemptotalcapital.nTotalamount,2) When tblFinalloop.cRowindicator='20' and tbltemptotalcapital.nTotalamount!=0 then Round(((tbltempporttotal.nTotalamount-tbltemptotalcapital.nTotalamount)*100/tbltemptotalcapital.nTotalamount)*365/ ((to_date('31/03/2024','dd/mm/yyyy') - to_date('01/04/2024','dd/mm/yyyy')+1)),2) else tblFinalloop.nSecamount end as nSecamount From tblFinalloop Left Outer Join tbltempportalloc On tblFinalloop.cClientcode=tbltempportalloc.cClientcode Left Outer Join tbltempporttotal On tblFinalloop.cClientcode=tbltempporttotal.cClientcode Left Outer Join tbltemptotalcapital On tblFinalloop.cClientcode=tbltemptotalcapital.cClientcode Order by 1 Title : 01~Error Description : ORA-01476: divisor is equal to zero Method : getglobalportfolioLine : 44015 Message : getGlobalportfolio StackTrace : at OracleInternal.ServiceObjects.OracleConnectionImpl.VerifyExecution(Int32& cursorId, Boolean bThrowArrayBindRelatedErrors, SqlStatementType sqlStatementType, Int32 arrayBindCount, OracleException& exceptionForArrayBindDML, Boolean& hasMoreRowsInDB, Boolean bFirstIterationDone) at OracleInternal.ServiceObjects.OracleCommandImpl.ExecuteReader(String commandText, OracleParameterCollection paramColl, CommandType commandType, OracleConnectionImpl connectionImpl, OracleDataReaderImpl& rdrImpl, Int32 longFetchSize, Int64 clientInitialLOBFS, OracleDependencyImpl orclDependencyImpl, Int64[] scnForExecution, Int64[]& scnFromExecution, OracleParameterCollection& bindByPositionParamColl, Boolean& bBindParamPresent, Int64& internalInitialLOBFS, OracleException& exceptionForArrayBindDML, OracleConnection connection, OracleLogicalTransaction& oracleLogicalTransaction, IEnumerable`1 adrianParsedStmt, Boolean isDescribeOnly, Boolean isFromEF) at Oracle.ManagedDataAccess.Client.OracleCommand.ExecuteReader(Boolean requery, Boolean fillRequest, CommandBehavior behavior) at Oracle.ManagedDataAccess.Client.OracleDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable) at clientlevel.Thinclientlevel.Clientlogin.getglobalportfolio(DateTime tdStartdate, DateTime tdEnddate, DateTime tdPoadate, DateTime tdFinancialstartdate, Int32 tnAngleselection, String tcClientfilter, Cliole loLdcommon) in File25:line 44015 Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 875442176 Shut down : N Username : MOBBO Date/Time : 17/05/2024 9:10:07 PM Connection : Closed =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Select tblFirmcreation.cshortname as cShortname From tblFirmcreation tblFirmcreation Where tblFirmcreation.cUserFirmcode='NBS-000001' Title : 01~Error Description : Value cannot be null. Parameter name: dataTable Method : AgeingacrossyearLine : 46316 Message : Ageingacrossyear StackTrace : at System.Data.Common.DataAdapter.Fill(DataTable[] dataTables, IDataReader dataReader, Int32 startRecord, Int32 maxRecords) at Oracle.ManagedDataAccess.Client.OracleDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable) at clientlevel.Thinclientlevel.Clientlogin.Ageingacrossyear(DateTime tdTransactiondate, Int32 tnTotaldays1, Int32 tnTotaldays2, Int32 tnTotaldays3, Int32 tnAngleselection, Int32 tnTotaldays4, Int32 tnTotaldays5, Int32 tnTotaldays6, Cliole loLdcommon, Int32 tnTotaldays7, Int32 tnTotaldays8, Int32 tnTotaldays9, Int32 tnTotaldays10, Int32 tnTotaldays11, Int32 tnTotaldays12, Int32 tnIncludepreviousyear, Int32 tnIgnorebounced, Int32 tnonlyReconciledentries, Int32 tnTerminalcodejoin, String& tcCashpayindate, String& tcFopayindate, Int32 tnAgeingonTransactiondate, String tcClientcode, Double tnAmount, String& tcSebiageingdate) in File25:line 46316 Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 751366144 Shut down : N Username : MOBBO Date/Time : 17/05/2024 9:15:46 PM Connection : Closed =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Select tblFirmcreation.cshortname as cShortname From tblFirmcreation tblFirmcreation Where tblFirmcreation.cUserFirmcode='NBS-000001' Title : 01~Error Description : Value cannot be null. Parameter name: dataTable Method : AgeingacrossyearLine : 46316 Message : Ageingacrossyear StackTrace : at System.Data.Common.DataAdapter.Fill(DataTable[] dataTables, IDataReader dataReader, Int32 startRecord, Int32 maxRecords) at Oracle.ManagedDataAccess.Client.OracleDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable) at clientlevel.Thinclientlevel.Clientlogin.Ageingacrossyear(DateTime tdTransactiondate, Int32 tnTotaldays1, Int32 tnTotaldays2, Int32 tnTotaldays3, Int32 tnAngleselection, Int32 tnTotaldays4, Int32 tnTotaldays5, Int32 tnTotaldays6, Cliole loLdcommon, Int32 tnTotaldays7, Int32 tnTotaldays8, Int32 tnTotaldays9, Int32 tnTotaldays10, Int32 tnTotaldays11, Int32 tnTotaldays12, Int32 tnIncludepreviousyear, Int32 tnIgnorebounced, Int32 tnonlyReconciledentries, Int32 tnTerminalcodejoin, String& tcCashpayindate, String& tcFopayindate, Int32 tnAgeingonTransactiondate, String tcClientcode, Double tnAmount, String& tcSebiageingdate) in File25:line 46316 Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 535261184 Shut down : N Username : MOBBO Date/Time : 17/05/2024 9:45:29 PM Connection : Closed =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Select tblFirmcreation.cshortname as cShortname From tblFirmcreation tblFirmcreation Where tblFirmcreation.cUserFirmcode='NBS-000001' Title : 01~Error Description : Value cannot be null. Parameter name: dataTable Method : AgeingacrossyearLine : 46316 Message : Ageingacrossyear StackTrace : at System.Data.Common.DataAdapter.Fill(DataTable[] dataTables, IDataReader dataReader, Int32 startRecord, Int32 maxRecords) at Oracle.ManagedDataAccess.Client.OracleDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable) at clientlevel.Thinclientlevel.Clientlogin.Ageingacrossyear(DateTime tdTransactiondate, Int32 tnTotaldays1, Int32 tnTotaldays2, Int32 tnTotaldays3, Int32 tnAngleselection, Int32 tnTotaldays4, Int32 tnTotaldays5, Int32 tnTotaldays6, Cliole loLdcommon, Int32 tnTotaldays7, Int32 tnTotaldays8, Int32 tnTotaldays9, Int32 tnTotaldays10, Int32 tnTotaldays11, Int32 tnTotaldays12, Int32 tnIncludepreviousyear, Int32 tnIgnorebounced, Int32 tnonlyReconciledentries, Int32 tnTerminalcodejoin, String& tcCashpayindate, String& tcFopayindate, Int32 tnAgeingonTransactiondate, String tcClientcode, Double tnAmount, String& tcSebiageingdate) in File25:line 46316 Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 665956352 Shut down : N Username : MOBBO Date/Time : 17/05/2024 10:25:55 PM Connection : Closed =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Select tblFirmcreation.cshortname as cShortname From tblFirmcreation tblFirmcreation Where tblFirmcreation.cUserFirmcode='NBS-000001' Title : 01~Error Description : Value cannot be null. Parameter name: dataTable Method : AgeingacrossyearLine : 46316 Message : Ageingacrossyear StackTrace : at System.Data.Common.DataAdapter.Fill(DataTable[] dataTables, IDataReader dataReader, Int32 startRecord, Int32 maxRecords) at Oracle.ManagedDataAccess.Client.OracleDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable) at clientlevel.Thinclientlevel.Clientlogin.Ageingacrossyear(DateTime tdTransactiondate, Int32 tnTotaldays1, Int32 tnTotaldays2, Int32 tnTotaldays3, Int32 tnAngleselection, Int32 tnTotaldays4, Int32 tnTotaldays5, Int32 tnTotaldays6, Cliole loLdcommon, Int32 tnTotaldays7, Int32 tnTotaldays8, Int32 tnTotaldays9, Int32 tnTotaldays10, Int32 tnTotaldays11, Int32 tnTotaldays12, Int32 tnIncludepreviousyear, Int32 tnIgnorebounced, Int32 tnonlyReconciledentries, Int32 tnTerminalcodejoin, String& tcCashpayindate, String& tcFopayindate, Int32 tnAgeingonTransactiondate, String tcClientcode, Double tnAmount, String& tcSebiageingdate) in File25:line 46316 Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 666472448 Shut down : N Username : MOBBO Date/Time : 17/05/2024 10:25:59 PM Connection : Closed =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : R2030002 With tbltempReport as (Select '01' as cRowindicator, 'Opening Market Value' as cRowdesc From Dual Union All Select '02' as cRowindicator, 'Capital In(+)/Out(-)' as cRowdesc From Dual Union All Select '03' as cRowindicator, Rpad(' ',8)||'Realized Profit (+)/(-)' as cRowdesc From dual Union All Select '04' as cRowindicator, 'Cash Segment' as cRowdesc From dual Union All Select '05' as cRowindicator, 'Derivatives Segment' as cRowdesc From dual Union All Select '06' as cRowindicator, 'Total Realized Profit(+)/(-) ' as cRowdesc From dual Union All Select '07' as cRowindicator, Rpad(' ',8)||'Un-Realized Profit (+)/(-) ' as cRowdesc From dual Union All Select '08' as cRowindicator, 'Cash Segment' as cRowdesc From dual Union All Select '09' as cRowindicator, 'Derivatives Segment' as cRowdesc From dual Union All Select '10' as cRowindicator, 'Total Un-Realized Profit(+)/(-) ' as cRowdesc From dual Union All Select '11' as cRowindicator, 'Total Dividend Amount' as cRowdesc From dual Union All Select '12' as cRowindicator, Rpad(' ',8)||'Statutory Charges' as cRowdesc From dual Union All Select '13' as cRowindicator, 'Cash Segment' as cRowdesc From dual Union All Select '14' as cRowindicator, 'Derivatives Segment' as cRowdesc From dual Union All Select '15' as cRowindicator, 'Misc. JV Entries' as cRowdesc From dual Union All Select '16' as cRowindicator, 'Direct Dividend Credit' as cRowdesc From dual Union All Select '17' as cRowindicator, 'Total Portfolio Allocation' as cRowdesc From dual Union All Select '18' as cRowindicator, 'Total No. of Days' as cRowdesc From dual Union All Select '19' as cRowindicator, 'Absolute Return' as cRowdesc From dual Union All Select '20' as cRowindicator, 'Annualized Return' as cRowdesc From dual Union All Select '24' as cRowindicator, Rpad(' ',8)||'Portfolio Allocation' as cRowdesc From dual Union All Select '25' as cRowindicator, 'Equity' as cRowdesc From dual Union All Select '26' as cRowindicator, 'Cash and Equivalent' as cRowdesc From dual Union All Select '27' as cRowindicator, 'Total Portfolio Allocation' as cRowdesc From dual ), tblReportdesc as (Select Ldfibs.Oowncode as cClientcode, tbltempReport.* From Ldfibs Ldfibs Left Outer Join tbltempReport On 1=1 Where Ldfibs.Firmnumber='NBS-000001' and (Ldfibs.Oowncode='R2030002') and Ldfibs.Brcode='495' ), tblOpendet as (Select Ledger.Oowncode as cClientcode, '01' as cRowindicator, Sum(Ledger.Damount-Ledger.Camount)*-1 as nSecamount From Ledger Ledger Where Ledger.Firmnumber='NBS-000001' and Ledger.nFinancialyear=2024 and (Ledger.Oowncode='R2030002') and Ledger.Branchcode='495' and Substr(Ledger.Voucher,1,4)='OPNG' group by Ledger.Oowncode Union All Select Sauda.Oowncode as cClientcode, '01' as cRowindicator, Sum(Sauda.Quantity*Sauda.Market) as nSecamount From Sauda Sauda Where Sauda.Egroup='OK' and Sauda.Firmnumber = 'NBS-000001' and (Sauda.Oowncode='R2030002') and Sauda.Brcode='495' group by Sauda.Oowncode ), tblOpenstk as (Select tblOpendet.cClientcode as cClientcode, Max(tblOpendet.cRowindicator) as cRowindicator, 0 as nFiramount, Sum(tblOpendet.nSecamount) as nSecamount From tblOpendet tblOpendet group by tblOpendet.cClientcode), tblCapinout as (Select Ledger.Oowncode as cClientcode, '02' as cRowindicator, 0 as nFiramount, Sum(Ledger.Damount-Ledger.Camount)*-1 as nSecamount From Ledger Ledger Where Ledger.Firmnumber='NBS-000001' and Ledger.nFinancialyear=2024 and (Ledger.Oowncode='R2030002') and Ledger.Branchcode='495' and Ledger.Dtoftran>=to_date('01/04/2023','dd/mm/yyyy') and Ledger.Dtoftran<=to_date('31/03/2024','dd/mm/yyyy') and (Substr(Ledger.Voucher,1,2)='RE' or Substr(Ledger.Voucher,1,2)='PY') group by Ledger.Oowncode ), tblFinledger as (Select Ledger.Oowncode as cClientcode, '26' as cRowindicator, Sum(Ledger.Damount-Ledger.Camount)*-1 as nFiramount, 0 as nSecamount From Ledger Ledger Where Ledger.Firmnumber='NBS-000001' and Ledger.nFinancialyear=2024 and (Ledger.Oowncode='R2030002') and Ledger.Branchcode='495' and Ledger.Dtoftran>=to_date('01/04/2023','dd/mm/yyyy') and Ledger.Dtoftran<=to_date('31/03/2024','dd/mm/yyyy') group by Ledger.Oowncode ), tblCashinternal as (Select Sauda.Oowncode as cClientcode, Sauda.Compcode as cScripcode, Sauda.Dtoftran as dBuydate, Sauda.BuySell as cBuysell, Sum(Sauda.Quantity) as nBuyquantity, Case When Sum(Sauda.Brokpercontract) = 0 Then Avg(Sauda.Final_Rat1) Else Case When Sauda.BuySell = 'B' Then Round(((Sum(Sauda.Quantity) * Avg(Sauda.Final_Rat1)) + Sum(Sauda.Brokpercontract)) / Sum(Sauda.Quantity), 10) Else Round(((Sum(Sauda.Quantity) * Avg(Sauda.Final_Rat1)) - Sum(Sauda.Brokpercontract)) / Sum(Sauda.Quantity), 10) End End as nBuynetrate, Sum(Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, Sauda.Quantity * -1))) Over(Partition By Sauda.Oowncode, Sauda.Compcode Order By Sauda.Dtoftran, Sauda.Final_Rat1 rows between current row and unbounded following) as nRunningqty, Sum(Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, 0))) Over(Partition By Sauda.Oowncode, Sauda.Compcode Order By Sauda.Dtoftran, Sauda.Final_Rat1 rows between current row and unbounded following) as nRunningbuytotal, Sum(Sum(Decode(Sauda.Buysell, 'S', Sauda.Quantity, 0))) Over(Partition By Sauda.Oowncode, Sauda.Compcode Order By Sauda.Dtoftran, Sauda.Final_Rat1 rows between current row and unbounded following) as nRunningselltotal, Sum(Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, 0))) Over(Partition By Sauda.Oowncode, Sauda.Compcode) as nSummarybuy, Sum(Sum(Decode(Sauda.Buysell, 'S', Sauda.Quantity, 0))) Over(Partition By Sauda.Oowncode, Sauda.Compcode) as nSummarysell, Sum(Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, 0)) * Case When Sum(Sauda.Brokpercontract) = 0 Then Avg(Sauda.Final_Rat1) Else Case When Sauda.BuySell = 'B' Then Round(((Sum(Sauda.Quantity) * Avg(Sauda.Final_Rat1)) + Sum(Sauda.Brokpercontract)) / Sum(Sauda.Quantity), 10) Else 0 End End) Over(Partition By Sauda.Oowncode, Sauda.Compcode) as nSumBuyamount, Sum(Sum(Decode(Sauda.Buysell, 'S', Sauda.Quantity, 0)) * Case When Sum(Sauda.Brokpercontract) = 0 Then Avg(Sauda.Final_Rat1) Else Case When Sauda.BuySell = 'B' Then 0 Else Round(((Sum(Sauda.Quantity) * Avg(Sauda.Final_Rat1)) - Sum(Sauda.Brokpercontract)) / Sum(Sauda.Quantity), 10) End End) Over(Partition By Sauda.Oowncode, Sauda.Compcode) as nSumSellamount, Sum(Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, Sauda.Quantity * -1))) Over(Partition By Sauda.Oowncode, Sauda.Compcode) As nNetquantity From Sauda Sauda Where Sauda.Firmnumber='NBS-000001' and Sauda.Egroup!='YC' and Sauda.Egroup != 'LB' and Sauda.Egroup != 'SR' and Sauda.Egroup != 'LA' and Sauda.Sterminal != '99999' and Sauda.Dtoftran 0 Then Case When tblCashinternal.nRunningbuytotal > tblCashinternal.nNetquantity Then tblCashinternal.nNetquantity + tblCashinternal.nBuyquantity - tblCashinternal.nRunningbuytotal Else tblCashinternal.nBuyquantity End When tblCashinternal.nNetquantity < 0 Then Case When Abs(tblCashinternal.nRunningselltotal) > Abs(tblCashinternal.nNetquantity) Then tblCashinternal.nNetquantity - tblCashinternal.nBuyquantity + tblCashinternal.nRunningselltotal Else tblCashinternal.nBuyquantity * -1 End End) as nOpStockquantity, Sum((Case When tblCashinternal.nNetquantity = 0 Then 0 When tblCashinternal.nNetquantity > 0 Then Case When tblCashinternal.nRunningbuytotal > tblCashinternal.nNetquantity Then tblCashinternal.nNetquantity + tblCashinternal.nBuyquantity - tblCashinternal.nRunningbuytotal Else tblCashinternal.nBuyquantity End When tblCashinternal.nNetquantity < 0 Then Case When Abs(tblCashinternal.nRunningselltotal) > Abs(tblCashinternal.nNetquantity) Then tblCashinternal.nNetquantity - tblCashinternal.nBuyquantity + tblCashinternal.nRunningselltotal Else tblCashinternal.nBuyquantity * -1 End End) * tblCashinternal.nBuynetrate) as nOpStockAmount from tblCashinternal Where (tblCashinternal.nNetquantity > 0 And tblCashinternal.cBuysell = 'B' And tblCashinternal.nRunningbuytotal <= tblCashinternal.nNetquantity + tblCashinternal.nBuyquantity) or (tblCashinternal.nNetquantity < 0 and tblCashinternal.cBuysell = 'S' and Abs(tblCashinternal.nRunningselltotal) <= Abs(tblCashinternal.nNetquantity) + tblCashinternal.nBuyquantity) Group By tblCashinternal.cClientcode, tblCashinternal.cScripcode), tblCashinternal1 as (Select Sauda.Oowncode as cClientcode, Sauda.Compcode as cScripcode, Sauda.Dtoftran as dBuydate, Sauda.BuySell as cBuysell, Sum(Sauda.Quantity) as nBuyquantity, Case When Sum(Sauda.Brokpercontract) = 0 Then Avg(Sauda.Final_Rat1) Else Case When Sauda.BuySell = 'B' Then Round(((Sum(Sauda.Quantity) * Avg(Sauda.Final_Rat1)) + Sum(Sauda.Brokpercontract)) / Sum(Sauda.Quantity), 10) Else Round(((Sum(Sauda.Quantity) * Avg(Sauda.Final_Rat1)) - Sum(Sauda.Brokpercontract)) / Sum(Sauda.Quantity), 10) End End as nBuynetrate, Sum(Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, Sauda.Quantity * -1))) Over(Partition By Sauda.Oowncode, Sauda.Compcode Order By Sauda.Dtoftran, Sauda.Final_Rat1 rows between current row and unbounded following) as nRunningqty, Sum(Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, 0))) Over(Partition By Sauda.Oowncode, Sauda.Compcode Order By Sauda.Dtoftran, Sauda.Final_Rat1 rows between current row and unbounded following) as nRunningbuytotal, Sum(Sum(Decode(Sauda.Buysell, 'S', Sauda.Quantity, 0))) Over(Partition By Sauda.Oowncode, Sauda.Compcode Order By Sauda.Dtoftran, Sauda.Final_Rat1 rows between current row and unbounded following) as nRunningselltotal, Sum(Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, 0))) Over(Partition By Sauda.Oowncode, Sauda.Compcode) as nSummarybuy, Sum(Sum(Decode(Sauda.Buysell, 'S', Sauda.Quantity, 0))) Over(Partition By Sauda.Oowncode, Sauda.Compcode) as nSummarysell, Sum(Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, 0)) * Case When Sum(Sauda.Brokpercontract) = 0 Then Avg(Sauda.Final_Rat1) Else Case When Sauda.BuySell = 'B' Then Round(((Sum(Sauda.Quantity) * Avg(Sauda.Final_Rat1)) + Sum(Sauda.Brokpercontract)) / Sum(Sauda.Quantity), 10) Else 0 End End) Over(Partition By Sauda.Oowncode, Sauda.Compcode) as nSumBuyamount, Sum(Sum(Decode(Sauda.Buysell, 'S', Sauda.Quantity, 0)) * Case When Sum(Sauda.Brokpercontract) = 0 Then Avg(Sauda.Final_Rat1) Else Case When Sauda.BuySell = 'B' Then 0 Else Round(((Sum(Sauda.Quantity) * Avg(Sauda.Final_Rat1)) - Sum(Sauda.Brokpercontract)) / Sum(Sauda.Quantity), 10) End End) Over(Partition By Sauda.Oowncode, Sauda.Compcode) as nSumSellamount, Sum(Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, Sauda.Quantity * -1))) Over(Partition By Sauda.Oowncode, Sauda.Compcode) As nNetquantity From Sauda Sauda Where Sauda.Firmnumber='NBS-000001' and Sauda.Egroup!='YC' and Sauda.Egroup != 'LB' and Sauda.Egroup != 'SR' and Sauda.Egroup != 'LA' and Sauda.Sterminal != '99999' and Sauda.Dtoftran<=to_date('31/03/2024','dd/mm/yyyy') and Sauda.Brcode='495' and (Sauda.Oowncode='R2030002') group by Sauda.Oowncode, Sauda.Dtoftran, Sauda.Final_Rat1, Sauda.buysell, Sauda.Compcode), tblClosing as (Select tblCashinternal1.cClientcode as cClientcode, tblCashinternal1.cScripcode as cScripcode, Sum(Case When tblCashinternal1.nNetquantity = 0 Then 0 When tblCashinternal1.nNetquantity > 0 Then Case When tblCashinternal1.nRunningbuytotal > tblCashinternal1.nNetquantity Then tblCashinternal1.nNetquantity + tblCashinternal1.nBuyquantity - tblCashinternal1.nRunningbuytotal Else tblCashinternal1.nBuyquantity End When tblCashinternal1.nNetquantity < 0 Then Case When Abs(tblCashinternal1.nRunningselltotal) > Abs(tblCashinternal1.nNetquantity) Then tblCashinternal1.nNetquantity - tblCashinternal1.nBuyquantity + tblCashinternal1.nRunningselltotal Else tblCashinternal1.nBuyquantity * -1 End End) AS nCLStockquantity, Sum((Case When tblCashinternal1.nNetquantity = 0 Then 0 When tblCashinternal1.nNetquantity > 0 Then Case When tblCashinternal1.nRunningbuytotal > tblCashinternal1.nNetquantity Then tblCashinternal1.nNetquantity + tblCashinternal1.nBuyquantity - tblCashinternal1.nRunningbuytotal Else tblCashinternal1.nBuyquantity End When tblCashinternal1.nNetquantity < 0 Then Case When Abs(tblCashinternal1.nRunningselltotal) > Abs(tblCashinternal1.nNetquantity) Then tblCashinternal1.nNetquantity - tblCashinternal1.nBuyquantity + tblCashinternal1.nRunningselltotal Else tblCashinternal1.nBuyquantity * -1 End End) * tblCashinternal1.nBuynetrate) as nClStockAmount from tblCashinternal1 Where (tblCashinternal1.nNetquantity > 0 And tblCashinternal1.cBuysell = 'B' And tblCashinternal1.nRunningbuytotal <= tblCashinternal1.nNetquantity + tblCashinternal1.nBuyquantity) or (tblCashinternal1.nNetquantity < 0 and tblCashinternal1.cBuysell = 'S' and Abs(tblCashinternal1.nRunningselltotal) <= Abs(tblCashinternal1.nNetquantity) + tblCashinternal1.nBuyquantity) Group By tblCashinternal1.cClientcode, tblCashinternal1.cScripcode), tblBuYSell as (Select Sauda.Oowncode as cClientcode, Sauda.Compcode as cScripcode, Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, 0)) as nbuyQty, Sum(Decode(Sauda.Buysell, 'S', Sauda.Quantity, 0)) as nsellQty, Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity * Sauda.Final_Rat1 , 0)+Case When Sauda.Buysell='B' then Sauda.Brokpercontract else 0 end) as nBuyamount, Sum(Decode(Sauda.Buysell, 'S', Sauda.Quantity * Sauda.Final_Rat1 , 0)-Case When Sauda.Buysell='S' then Sauda.Brokpercontract else 0 end) as nSellamount From Sauda Sauda Where Sauda.Firmnumber='NBS-000001' and Sauda.Egroup!='YC' and Sauda.Egroup != 'LB' and Sauda.Egroup != 'SR' and Sauda.Egroup != 'LA' and Sauda.Sterminal != '99999' and Sauda.Dtoftran>=to_date('01/04/2023','dd/mm/yyyy') and Sauda.Dtoftran<=to_Date('31/03/2024','dd/mm/yyyy') and Sauda.Brcode='495' and (Sauda.Oowncode='R2030002') group by Sauda.Oowncode, Sauda.Compcode), tblCashcost as (Select Coalesce(tblOpening.cClientcode,tblClosing.cClientcode,tblBuysell.cClientcode) as cClientcode, Coalesce(tblOpening.cScripcode,tblClosing.cScripcode,tblBuysell.cScripcode) as cScripcode, Nvl(tblOpening.nOpstockquantity,0) as nOpstockquantity, Nvl(tblOpening.nOpstockamount,0) as nOpstockamount, Case When Nvl(tblOpening.nOpstockquantity,0)!=0 then Round(Nvl(tblOpening.nOpstockamount,0)/Nvl(tblOpening.nOpstockquantity,0),4) else 0 end as nOpstockavg, Nvl(tblBuysell.nBuyqty,0) as nPrePurchqty, Nvl(tblBuysell.nBuyamount,0) as nPrePurchvalue, Case When Nvl(tblBuysell.nBuyqty,0) !=0 then Round(Nvl(tblBuysell.nBuyamount,0)/Nvl(tblBuysell.nBuyqty,0),4) else 0 end as nPrePurchavg, Nvl(tblBuysell.nSellQty, 0) as nPreSellqty, Nvl(tblBuysell.nSellamount, 0) as nPreSellvalue, Case When Nvl(tblBuysell.nSellQty, 0) != 0 then Round(Nvl(tblBuysell.nSellamount, 0) / Nvl(tblBuysell.nSellQty, 0), 4) else 0 end as nPreSellavg, Least((Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockquantity, 0) + Nvl(tblBuysell.nBuyqty, 0) Else Nvl(tblBuysell.nBuyqty, 0) End), (Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockquantity, 0)) + Nvl(tblBuysell.nSellqty, 0) Else Nvl(tblBuysell.nSellqty, 0) End)) as nPurchqty, Round((Case When (Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockquantity, 0) + Nvl(tblBuysell.nBuyqty, 0) Else Nvl(tblBuysell.nBuyqty, 0) End) <= (Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockquantity, 0)) + Nvl(tblBuysell.nSellqty, 0) Else Nvl(tblBuysell.nSellqty, 0) End) Then Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockAmount, 0) + Nvl(tblBuysell.nBuyAmount, 0) Else Nvl(tblBuysell.nBuyAmount, 0) End Else Nvl(tblBuysell.nBuyAmount, 0) + Nvl(tblOpening.nOpstockAmount, 0) - nvl(tblClosing.nClStockAmount, 0) End), 2) as nPurchvalue, Round((Case When Least((Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockquantity, 0) + Nvl(tblBuysell.nBuyqty, 0) Else Nvl(tblBuysell.nBuyqty, 0) End), (Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockquantity, 0)) + Nvl(tblBuysell.nSellqty, 0) Else Nvl(tblBuysell.nSellqty, 0) End)) != 0 Then (Case When (Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockquantity, 0) + Nvl(tblBuysell.nBuyqty, 0) Else Nvl(tblBuysell.nBuyqty, 0) End) <= (Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockquantity, 0)) + Nvl(tblBuysell.nSellqty, 0) Else Nvl(tblBuysell.nSellqty, 0) End) Then Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockAmount, 0) + Nvl(tblBuysell.nBuyAmount, 0) Else Nvl(tblBuysell.nBuyAmount, 0) End Else Nvl(tblBuysell.nBuyAmount, 0) + Nvl(tblOpening.nOpstockAmount, 0) - nvl(tblClosing.nClStockAmount, 0) End) / (Least((Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockquantity, 0) + Nvl(tblBuysell.nBuyqty, 0) Else Nvl(tblBuysell.nBuyqty, 0) End), (Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockquantity, 0)) + Nvl(tblBuysell.nSellqty, 0) Else Nvl(tblBuysell.nSellqty, 0) End))) Else 0 End), 4) as nPurchavg, Least((Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockquantity, 0) + Nvl(tblBuysell.nBuyqty, 0) Else Nvl(tblBuysell.nBuyqty, 0) End), (Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockquantity, 0)) + Nvl(tblBuysell.nSellqty, 0) Else Nvl(tblBuysell.nSellqty, 0) End)) as nSalesqty, Round((Case When (Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockquantity, 0) + Nvl(tblBuysell.nBuyqty, 0) Else Nvl(tblBuysell.nBuyqty, 0) End) >= (Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockquantity, 0)) + Nvl(tblBuysell.nSellqty, 0) Else Nvl(tblBuysell.nSellqty, 0) End) Then Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockAmount, 0)) + Nvl(tblBuysell.nSellAmount, 0) Else Nvl(tblBuysell.nSellAmount, 0) End Else Nvl(tblBuysell.nSellAmount, 0) - Nvl(tblOpening.nOpstockAmount, 0) + nvl(tblClosing.nClStockAmount, 0) End), 2) as nSalesvalue, Round((Case When Least((Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockquantity, 0) + Nvl(tblBuysell.nBuyqty, 0) Else Nvl(tblBuysell.nBuyqty, 0) End), (Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockquantity, 0)) + Nvl(tblBuysell.nSellqty, 0) Else Nvl(tblBuysell.nSellqty, 0) End)) != 0 Then (Case When (Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockquantity, 0) + Nvl(tblBuysell.nBuyqty, 0) Else Nvl(tblBuysell.nBuyqty, 0) End) >= (Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockquantity, 0)) + Nvl(tblBuysell.nSellqty, 0) Else Nvl(tblBuysell.nSellqty, 0) End) Then Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockAmount, 0)) + Nvl(tblBuysell.nSellAmount, 0) Else Nvl(tblBuysell.nSellAmount, 0) End Else Nvl(tblBuysell.nSellAmount, 0) - Nvl(tblOpening.nOpstockAmount, 0) + nvl(tblClosing.nClStockAmount, 0) End) / (Least((Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockquantity, 0) + Nvl(tblBuysell.nBuyqty, 0) Else Nvl(tblBuysell.nBuyqty, 0) End), (Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockquantity, 0)) + Nvl(tblBuysell.nSellqty, 0) Else Nvl(tblBuysell.nSellqty, 0) End))) ELse 0 End), 4) as nSalesavg, Nvl(tblClosing.nClstockquantity, 0) as nOsstock, Nvl(tblClosing.nClstockamount, 0) as nOsstockvalue, Case When Nvl(tblClosing.nClstockquantity, 0) != 0 then Round(Nvl(tblClosing.nClstockamount, 0) / Nvl(tblClosing.nClstockquantity, 0), 4) else 0 end as nOsstockavg, (nvl(tblBuySell.nSellAmount, 0) - nvl(tblOpening.nOpStockAmount, 0) - nvl(tblBuySell.nBuyAmount, 0) + nvl(tblClosing.nClStockAmount, 0)) as nProfitloss, ((Market.Market * nvl(tblClosing.nClstockquantity, 0)) - Nvl(tblClosing.nClstockamount, 0)) As nUnrealprlo, (nvl(tblBuySell.nSellAmount, 0) - nvl(tblOpening.nOpStockAmount, 0) - nvl(tblBuySell.nBuyAmount, 0) + nvl(tblClosing.nClStockAmount, 0)) + ((Market.Market * nvl(tblClosing.nClstockquantity, 0)) - Nvl(tblClosing.nClstockamount, 0)) As nOverallprlo, Market.Market as nMarketrate, Market.Market*Nvl(tblClosing.nClstockquantity,0) As nMarketvalue from tblOPening tblOpening Full Join TblClosing on tblOpening.cclientcode = tblclosing.cclientcode and tblOPening.cScripcode = tblClosing.cScripcode Full Join TblBuySell on tblBuySell.cclientcode = coalesce(tblOpening.cclientcode, tblclosing.cclientcode) and tblBuySell.cScripcode = coalesce(tblOPening.cScripcode, tblClosing.cScripcode) Left Outer Join Market Market On Market.Firmnumber='NBS-000001' and Market.code=coalesce(tblOpening.cScripcode, tblclosing.cScripcode, tblBuysell.cScripcode) ), tblOpendet as (Select Ledger.Oowncode as cClientcode, '01' as cRowindicator, Sum(Ledger.Damount-Ledger.Camount)*-1 as nSecamount From Ledger Ledger Where Ledger.Firmnumber='NBS-000001' and Ledger.nFinancialyear = 2024 and (Ledger.Oowncode='R2030002') and Ledger.Branchcode='495' and Substr(Ledger.Voucher,1,4)='OPNG' group by Ledger.Oowncode Union All Select tblCashcost.cClientcode as cClientcode, '01' as cRowindicator, Sum(tblCashcost.nOpstockamount) as nSecamount From tblCashcost tblCashcost group by tblCashcost.cClientcode ), tblOpenstk as (Select tblOpendet.cClientcode as cClientcode, Max(tblOpendet.cRowindicator) as cRowindicator, 0 as nFiramount, Sum(tblOpendet.nSecamount) as nSecamount From tblOpendet tblOpendet group by tblOpendet.cClientcode), tblPortcashfin as (Select tblCashcost.cClientcode as cClientcode, '04' as cRowindicator, Sum(tblCashcost.nProfitloss) as nFiramount, 0 as nSecamount From tblCashcost tblCashcost group by tblCashcost.cClientcode Union All Select tblCashcost.cClientcode as cClientcode, '25' as cRowindicator, Sum(tblCashcost.nMarketvalue) as nFiramount, 0 as nSecamount From tblCashcost tblCashcost group by tblCashcost.cClientcode Union All Select tblCashcost.cClientcode as cClientcode, '08' as cRowindicator, Sum(tblCashcost.nUnrealprlo) as nFiramount, 0 as nSecamount From tblCashcost tblCashcost group by tblCashcost.cClientcode ), tblFointernal as (Select Fosauda.Oowncode as cClientcode, Fosauda.Compcode as cScripcode, Fosauda.Strikeprice as nStrikeprice, Fosauda.Optiontype as cOptiontype, Company.Fibsacct as cScripname, Company.Expirydate as dExpirydate, Exchange.Operation as cOperation, Company.Instrutyp as cInstrutyp, Company.nBaseunit as nBaseunit, Company.cUnitofmeasurement as cUnitofmeasurement, Company.cUnitofTrading as cUnitofTrading, Company.nTradeablelot as nTradeablelot, Company.nPricenumerator as nPricenumerator, Company.nPricedenominator as nPricedenominator, Company.nGeneralnumerator as nGeneralnumerator, Company.nGeneraldenominator as nGeneraldenominator, Fosauda.Dtoftran as dBuydate, Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') or Fosauda.Optiontype != 'PO' Then Fosauda.Buysell else Case When Fosauda.Buysell = 'B' Then 'S' Else 'B' End end as cBuysell, Sum(Fosauda.quantity) as nBuyquantity, Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') Then Case When Sum(Fosauda.nValuebrokerage) = 0 then Avg(Fosauda.Final_Rat1) else Case When Fosauda.BuySell = 'B' Then Round(((Sum(Fosauda.Quantity) * Avg(Fosauda.Final_Rat1)) + Sum(Fosauda.nValuebrokerage)) / Sum(Fosauda.Quantity), 10) Else Round(((Sum(Fosauda.Quantity) * Avg(Fosauda.Final_Rat1)) - Sum(Fosauda.nValuebrokerage)) / Sum(Fosauda.Quantity), 10) End End Else Case When Fosauda.Buysell = 'B' Then Avg(Fosauda.Final_rat1) - Avg(Fosauda.Strikeprice) else Avg(Fosauda.Strikeprice) - Avg(Fosauda.Final_rat1) End End as nBuynetrate, Sum(Sum(Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') or Fosauda.Optiontype != 'PO' Then Decode(Fosauda.Buysell, 'B', Fosauda.Quantity, Fosauda.Quantity * -1) Else Decode(Fosauda.Buysell, 'S', Fosauda.Quantity, Fosauda.Quantity * -1) End)) Over(Partition By Fosauda.Oowncode, Company.Fibsacct, Fosauda.Strikeprice, Fosauda.Optiontype Order By Fosauda.Dtoftran, Fosauda.Final_Rat1 rows between current row and unbounded following) as nRunningqty, Sum(Sum(Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') or Fosauda.optiontype != 'PO' Then Decode(Fosauda.Buysell, 'B', Fosauda.Quantity, 0) Else Decode(Fosauda.Buysell, 'S', Fosauda.Quantity, 0) End)) Over(Partition By Fosauda.Oowncode, Company.Fibsacct, Fosauda.Strikeprice, Fosauda.Optiontype Order By Fosauda.Dtoftran, Fosauda.Final_Rat1 rows between current row and unbounded following) as nRunningbuytotal, Sum(Sum(Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') or Fosauda.Optiontype != 'PO' Then Decode(Fosauda.Buysell, 'S', Fosauda.Quantity, 0) Else Decode(Fosauda.Buysell, 'B', Fosauda.Quantity, 0) End)) Over(Partition By Fosauda.Oowncode, Company.Fibsacct, Fosauda.Strikeprice, Fosauda.Optiontype Order By Fosauda.Dtoftran, Fosauda.Final_Rat1 rows between current row and unbounded following) as nRunningselltotal, Sum(Sum(Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') or Fosauda.optiontype != 'PO' Then Decode(Fosauda.Buysell, 'B', Fosauda.Quantity, 0) Else Decode(Fosauda.Buysell, 'S', Fosauda.Quantity, 0) End)) Over(Partition By Fosauda.Oowncode, Company.Fibsacct, Fosauda.Strikeprice, Fosauda.Optiontype) as nSummarybuy, Sum(Sum(Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') or Fosauda.optiontype != 'PO' Then Decode(Fosauda.Buysell, 'S', Fosauda.Quantity, 0) Else Decode(Fosauda.Buysell, 'B', Fosauda.Quantity, 0) End)) Over(Partition By Fosauda.Oowncode, Company.Fibsacct, Fosauda.Strikeprice, Fosauda.Optiontype) as nSummarysell, Sum(Sum(Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') or Fosauda.Optiontype != 'PO' Then Decode(Fosauda.Buysell, 'B', Fosauda.Quantity, 0) Else Decode(Fosauda.Buysell, 'S', Fosauda.Quantity, 0) End) * Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') Then Case When Sum(Fosauda.nValuebrokerage) = 0 then Avg(Fosauda.Final_Rat1) else Case When Fosauda.BuySell = 'B' Then Round(((Sum(Fosauda.Quantity) * Avg(Fosauda.Final_Rat1)) + Sum(Fosauda.nValuebrokerage)) / Sum(Fosauda.Quantity), 10) Else Round(((Sum(Fosauda.Quantity) * Avg(Fosauda.Final_Rat1)) - Sum(Fosauda.nValuebrokerage)) / Sum(Fosauda.Quantity), 10) End End Else Abs(Avg(Fosauda.Final_Rat1) - Avg(fosauda.strikeprice)) End) Over(Partition By Fosauda.Oowncode, Company.Fibsacct, Fosauda.Strikeprice, Fosauda.Optiontype) as nSumBuyamount, Sum(Sum(Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') or Fosauda.Optiontype != 'PO' Then Decode(Fosauda.Buysell, 'S', Fosauda.Quantity, 0) Else Decode(Fosauda.Buysell, 'B', Fosauda.Quantity, 0) End) * Case When (Fosauda.saudatype != 'AS' and Fosauda.Saudatype != 'EX') Then Case When Sum(Fosauda.nValuebrokerage) = 0 then Avg(Fosauda.Final_Rat1) else Case When Fosauda.BuySell = 'B' Then Round(((Sum(Fosauda.Quantity) * Avg(Fosauda.Final_Rat1)) + Sum(Fosauda.nValuebrokerage)) / Sum(Fosauda.Quantity), 10) Else Round(((Sum(Fosauda.Quantity) * Avg(Fosauda.Final_Rat1)) - Sum(Fosauda.nValuebrokerage)) / Sum(Fosauda.Quantity), 10) End End Else Abs(Avg(Fosauda.Final_Rat1) - Avg(fosauda.strikeprice)) End) Over(Partition By Fosauda.Oowncode, Company.Fibsacct, Fosauda.Strikeprice, Fosauda.Optiontype) as nSumSellamount, Sum(Sum(Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') or Fosauda.optiontype != 'PO' Then Decode(Fosauda.Buysell, 'B', Fosauda.Quantity, Fosauda.Quantity * -1) Else Decode(Fosauda.Buysell, 'S', Fosauda.Quantity, Fosauda.Quantity * -1) End)) Over(Partition By Fosauda.Oowncode, Company.Fibsacct, Fosauda.Strikeprice, Fosauda.Optiontype) As nNetquantity From Fosauda Fosauda Inner Join Company Company On Fosauda.firmnumber = Company.Firmnumber and Fosauda.Compcode = Company.oowncode Inner Join Exchange Exchange On Fosauda.Firmnumber = Exchange.Firmnumber and Fosauda.Exchcode = Exchange.Code Where Fosauda.Firmnumber = 'NBS-000001' and Fosauda.Egroup != 'YF' and Fosauda.Egroup != 'LB' and Fosauda.Egroup != 'SR' and Fosauda.Egroup != 'LA' and Fosauda.Sterminal != '99999' and (Fosauda.Oowncode='R2030002') and Fosauda.Brcode='495' and Fosauda.Dtoftran>=to_date('01/04/2023','dd/mm/yyyy') and Fosauda.Dtoftran<=to_date('31/03/2024','dd/mm/yyyy') and ((Fosauda.Saudatype != 'B/' and Fosauda.Orignalno = 0) or (Fosauda.Saudatype = 'B/' and (Fosauda.Orignalno = -99 or Fosauda.Dtoftran=to_date('01/04/2023','dd/mm/yyyy')))) group by Fosauda.Oowncode, Company.Fibsacct, Company.Expirydate, Exchange.Operation, Company.Instrutyp, Company.nBaseunit, Company.cUnitofmeasurement, Company.cUnitofTrading, Company.nTradeablelot, Company.nPricenumerator, Company.nPricedenominator, Company.nGeneralnumerator, Company.nGeneraldenominator, Fosauda.Dtoftran, Fosauda.Final_Rat1, Fosauda.buysell, Fosauda.Compcode, Fosauda.Strikeprice, Fosauda.Saudatype, Fosauda.Optiontype), tblFocost as (Select tblFointernal.cClientcode as cClientcode, tblFointernal.cScripcode as cScripcode, tblFointernal.nStrikeprice as nStrikeprice, tblFointernal.cOptiontype as cOptiontype, tblFointernal.cScripname as cScripname, tblFointernal.cOperation as cOperation, tblFoInternal.cInstrutyp as cInstrutyp, tblFoInternal.nBaseunit as nBaseunit, tblFoInternal.cUnitofmeasurement as cUnitofmeasurement, tblFoInternal.cUnitofTrading as cUnitofTrading, tblFoInternal.nTradeablelot as nTradeablelot, tblFoInternal.nPricenumerator as nPricenumerator, tblFoInternal.nPricedenominator as nPricedenominator, tblFoInternal.nGeneralnumerator as nGeneralnumerator, tblFoInternal.nGeneraldenominator as nGeneraldenominator, tblFointernal.dExpirydate as dExpirydate, tblFointernal.dBuydate as dBuydate, tblFointernal.nBuynetrate as nBuynetrate, Case When tblFointernal.nNetquantity = 0 Then 0 When tblFointernal.nNetquantity > 0 Then Case When tblFointernal.nRunningbuytotal > tblFointernal.nNetquantity Then tblFointernal.nNetquantity + tblFointernal.nBuyquantity - tblFointernal.nRunningbuytotal Else tblFointernal.nBuyquantity End When tblFointernal.nNetquantity < 0 Then Case When abs(tblFointernal.nRunningselltotal) > abs(tblFointernal.nNetquantity) Then tblFointernal.nNetquantity - tblFointernal.nBuyquantity + tblFointernal.nRunningselltotal Else tblFointernal.nBuyquantity * -1 End End AS nStockquantity, tblFointernal.nSummarybuy as nSummarybuy, tblFointernal.nSumBuyamount as nSumbuyamount, tblFointernal.nSummarysell as nSummarysell, tblFointernal.nSumSellamount as nSumsellamount From tblFointernal tblFoInternal Where (tblFointernal.nNetquantity > 0 and tblFointernal.cBuysell = 'B' and tblFointernal.nRunningbuytotal <= tblFointernal.nNetquantity + tblFointernal.nBuyquantity) or (tblFointernal.nNetquantity < 0 and tblFointernal.cBuysell = 'S' and abs(tblFointernal.nRunningselltotal) <= Abs(tblFointernal.nNetquantity) + tblFointernal.nBuyquantity) or (tblFointernal.nNetquantity = 0 And tblFointernal.nRunningselltotal = tblFointernal.nSummarysell and tblFointernal.nRunningbuytotal = tblFointernal.nSummarybuy)), tblFinalcost as (Select tblFocost.cClientcode as cClientcode, tblFocost.cScripcode as cScripcode, tblFocost.nStrikeprice as nStrikeprice, tblFocost.cOptiontype as cOptiontype, tblFocost.dExpirydate as dExpirydate, tblFocost.cScripname as cScripname, tblFocost.cOperation as cOperation, tblFocost.cInstrutyp as cInstrutyp, tblFocost.nBaseunit as nBaseunit, tblFocost.cUnitofmeasurement as cUnitofmeasurement, tblFocost.cUnitofTrading as cUnitofTrading, tblFocost.nTradeablelot as nTradeablelot, tblFocost.nPricenumerator as nPricenumerator, tblFocost.nPricedenominator as nPricedenominator, tblFocost.nGeneralnumerator as nGeneralnumerator, tblFocost.nGeneraldenominator as nGeneraldenominator, tblFocost.nSummarybuy - (Case When Sum(tblFocost.nStockquantity) > 0 then Sum(tblFocost.nStockquantity) else 0 end) As nPurchqty, tblFocost.nSumbuyamount - (Case When Sum(tblFocost.nStockquantity) > 0 then Sum(tblFocost.nStockquantity * tblFocost.nBuyNetRate) else 0 end) As nPurchvalue, tblFocost.nSummarysell - (Case When Sum(tblFocost.nStockquantity) < 0 then Sum(Abs(tblFocost.nStockquantity)) else 0 end) as nSalesqty, tblFocost.nSumSellamount - (Case When Sum(tblFocost.nStockquantity) < 0 then Sum(Abs(tblFocost.nStockquantity) * tblFocost.nBuyNetRate) else 0 end) as nSalesvalue, Sum(tblFocost.nStockquantity) As nOsstock, Case When Sum(tblFocost.nStockquantity) != 0 then Round(Sum(tblFocost.nStockquantity * tblFocost.nBuyNetRate) / Sum(tblFocost.nStockquantity), 4) else 0 end as nOsstockavg, Sum(tblFocost.nStockquantity * tblFocost.nBuyNetRate) as nOsstockvalue, tblFocost.nSumSellamount + Sum(tblFocost.nStockquantity * tblFocost.nBuyNetRate) - tblFocost.nSumBuyamount as nProfitLoss, Max(Market.Market) as nMarketrate, Max(Market.Market) * Sum(tblFocost.nStockquantity) as nMarketvalue, ((tblFocost.nSumSellamount + Sum(tblFocost.nStockquantity * tblFocost.nBuyNetRate) - tblFocost.nSumBuyamount)) + ((Max(Market.Market) * Sum(tblFocost.nStockquantity)) - (Sum(tblFocost.nStockquantity * tblFocost.nBuyNetRate))) as nOverallprlo, Max(Market.nPrvcloseprice) as nPrvcloseprice, Max(Market.nHighprice) as nHighprice, Max(Market.nLowprice) as nLowprice, Max(Market.nLowercircuitLimit) as nLowercircuitlimit, Max(Market.nOpenprice) as nOpenprice, Max(Market.nUppercircuitlimit) as nUppercircuitlimit, Max(Market.nNoofTrades) as nNooftrades, Max(Market.nVoltradedToday) as nVoltradedtoday, Max(Market.nVolquantity) as nVolquantity, Max(Market.dLastupdatedate) as dlastupdatedate, Max(Market.n52Weeklow) as n52Weeklow, Max(Market.n52WeekHigh) as n52Weekhigh From tblFocost tblFocost Left Outer Join Market Market On Market.Firmnumber = 'NBS-000001' and tblFocost.cScripcode = Market.Code and tblFocost.nStrikeprice = Market.Strikeprice and tblFocost.cOptiontype = Market.Optiontype and ((Market.nOptmethod = 0 and tblFocost.nStrikeprice = 0) or (Market.nOptmethod = 1 and tblFocost.nStrikeprice != 0)) Group By tblFocost.cClientcode, tblFocost.cScripcode, tblFocost.cScripname, tblFocost.cOperation, tblFocost.cInstrutyp, tblFocost.nBaseunit, tblFocost.cUnitofmeasurement, tblFocost.cUnitofTrading, tblFocost.nTradeablelot, tblFocost.nPricenumerator, tblFocost.nPricedenominator, tblFocost.nGeneralnumerator, tblFocost.nGeneraldenominator, tblFocost.dExpirydate, tblFocost.nStrikeprice, tblFocost.cOptiontype, tblFocost.nSummarybuy, tblFocost.nSumBuyamount, tblFocost.nSummarysell, tblFocost.nSumSellamount), tblPortderfinal as (Select tblFinalcost.cClientcode as cClientcode, tblFinalcost.cScripcode as cScripcode, tblFinalcost.cScripname as cScripname, tblFinalcost.cOperation as cOperation, tblFinalcost.cInstrutyp as cInstrutyp, tblFinalcost.nBaseunit as nBaseunit, tblFinalcost.cUnitofmeasurement as cUnitofmeasurement, tblFinalcost.cUnitofTrading as cUnitofTrading, tblFinalcost.nTradeablelot as nTradeablelot, tblFinalcost.nPricenumerator as nPricenumerator, tblFinalcost.nPricedenominator as nPricedenominator, tblFinalcost.nGeneralnumerator as nGeneralnumerator, tblFinalcost.nGeneraldenominator as nGeneraldenominator, tblFinalcost.nStrikeprice as nStrikeprice, tblFinalcost.cOptiontype as cOptiontype, tblFinalcost.dExpirydate as dExpirydate, tblFinalcost.nPurchqty As nPurchqty, tblFinalcost.nPurchvalue As nPurchvalue, Round(Case When tblFinalcost.nPurchqty != 0 then tblFinalcost.nPurchvalue / tblFinalcost.nPurchqty else 0 End, 4) As nPurchavg, tblFinalcost.nSalesqty as nSalesqty, tblFinalcost.nSalesvalue as nSalesvalue, Round(Case When tblFinalcost.nSalesqty != 0 then tblFinalcost.nSalesvalue / tblFinalcost.nSalesqty else 0 end, 4) as nSalesavg, tblFinalcost.nOsstock As nOsstock, tblFinalcost.nOsstockavg as nOsstockavg, tblFinalcost.nOsstockvalue as nOsstockvalue, tblFinalcost.nMarketrate as nMarketrate, tblFinalcost.nMarketvalue as nMarketvalue, ((tblFinalcost.nMarketrate * tblFinalcost.nOsstock) - (tblFinalcost.nOsstock * tblFinalcost.nOsstockavg)) as nUnrealprlo, tblFinalcost.nProfitloss as nProfitLoss, tblFinalcost.nOverallprlo as nOverallprlo, tblFinalcost.nPrvcloseprice as nPrvcloseprice, tblFinalcost.nHighprice as nHighprice, tblFinalcost.nLowprice as nLowprice, tblFinalcost.nLowercircuitLimit as nLowercircuitlimit, tblFinalcost.nOpenprice as nOpenprice, tblFinalcost.nUppercircuitlimit as nUppercircuitlimit, tblFinalcost.nNooftrades as nNooftrades, tblFinalcost.nVoltradedtoday as nVoltradedtoday, tblFinalcost.nVolquantity as nVolquantity, tblFinalcost.dLastupdatedate as dlastupdatedate, tblFinalcost.n52WeekLow as n52Weeklow, tblFinalcost.n52Weekhigh as n52Weekhigh From tblFinalcost tblFinalcost Order by tblFinalcost.cClientcode, tblFinalcost.cScripname, tblFinalcost.nStrikeprice, tblFinalcost.cOptiontype, tblFinalcost.dExpirydate ), tblPortderfin as (Select tblPortderfinal.cClientcode as cClientcode, '05' as cRowindicator, Sum(tblPortderfinal.nProfitloss) as nFiramount, 0 as nSecamount From tblPortderfinal tblPortderfinal group by tblPortderfinal.cClientcode Union All Select tblPortderfinal.cClientcode as cClientcode, '09' as cRowindicator, Sum(tblPortderfinal.nUnrealprlo) as nFiramount, 0 as nSecamount From tblPortderfinal tblPortderfinal group by tblPortderfinal.cClientcode), tblCashplusderfinal as (Select Coalesce(tblPortcashfin.cClientcode,tblPortderfin.cClientcode) as cClientcode, Case When Coalesce(tblPortcashfin.cRowindicator,tblPortderfin.cRowindicator)='04' or Coalesce(tblPortcashfin.cRowindicator,tblPortderfin.cRowindicator)='05' then '06' else '10' end as cRowindicator, 0 as nFiramount, Sum(Coalesce(tblPortcashfin.nFiramount,tblPortderfin.nFiramount,0)) as nSecamount From tblPortcashfin Full outer join tblPortderfin On tblPortcashfin.cClientcode=tblPortderfin.cClientcode and tblPortcashfin.cRowindicator=tblPortderfin.cRowindicator Where tblPortcashfin.cRowindicator='04' or tblPortcashfin.cRowindicator='08' or tblPortderfin.cRowindicator='05' or tblPortderfin.cRowindicator='09' group by Coalesce(tblPortcashfin.cClientcode,tblPortderfin.cClientcode) , Case When Coalesce(tblPortcashfin.cRowindicator,tblPortderfin.cRowindicator)='04' or Coalesce(tblPortcashfin.cRowindicator,tblPortderfin.cRowindicator)='05' then '06' else '10' end ), tblDividend as (Select Ledger.Oowncode as cClientcode, '11' as cRowindicator, 0 as nFiramount, Sum(Ledger.damount-Ledger.Camount)*-1 as nSecamount From Ledger Ledger Inner Join Journal On Ledger.Firmnumber=Journal.Firmnumber and Ledger.Voucher=Journal.Jvnumber and Ledger.nFinancialyear=Journal.nFinancialyear Where Ledger.Firmnumber='NBS-000001' and Ledger.nFinancialyear=2024 and (Ledger.Oowncode='R2030002') and Ledger.Branchcode='495' and Ledger.Dtoftran>=to_date('01/04/2023','dd/mm/yyyy') and Ledger.Dtoftran<=to_date('31/03/2024','dd/mm/yyyy') and Journal.nEntrytype=1 group by Ledger.Oowncode ), tblDirectDividend as (Select tblDirectdiv.cClientcode as cClientcode, '16' as cRowindicator, 0 as nFiramount, Sum(tblDirectdiv.nQuantity*tblDirectdiv.nRate)*-1 as nSecamount From tblDirectdiv tblDirectdiv Inner Join Ldfibs Ldfibs On tblDirectdiv.cFirmnumber = Ldfibs.Firmnumber and tblDirectdiv.cClientcode = Ldfibs.Oowncode Where tblDirectdiv.cFirmnumber='NBS-000001' and (tblDirectdiv.cClientcode='R2030002') and tblDirectdiv.dDtoftran>=to_date('01/04/2023','dd/mm/yyyy') and tblDirectdiv.dDtoftran<=to_date('31/03/2024','dd/mm/yyyy') group by tblDirectdiv.cClientcode ), tbltmpBillcharges as (Select Billcharges.Oowncode as cClientcode, Case When Billcharges.Egroup='FU' then '14' else '13' end as cRowindicator, Sum(Billcharges.Quantity*Billcharges.Final_Rat1) as nFiramount, 0 as nSecamount From Billcharges Billcharges Where Billcharges.Firmnumber='NBS-000001' and Billcharges.Brcode='495' and (Billcharges.Oowncode='R2030002') and Billcharges.Dtoftran>=to_date('01/04/2023','dd/mm/yyyy') and Billcharges.Dtoftran<=to_date('31/03/2024','dd/mm/yyyy') group by Billcharges.Oowncode, Case When Billcharges.Egroup='FU' then '14' else '13' end ), tbltmpbillchgtotal as (Select tbltmpBillcharges.cClientcode as cClientcode, '12' as cRowindicator, 0 as nFiramount, Sum(tbltmpBillcharges.nFiramount) as nSecamount from tbltmpBillcharges tbltmpBillcharges group by tbltmpbillcharges.cClientcode ), tblMiscentries as ( Select Ledger.Oowncode as cClientcode, '15' as cRowindicator, 0 as nFiramount, Sum(Ledger.damount-Ledger.Camount)*-1 as nSecamount From Ledger Ledger Inner Join Journal On Ledger.Firmnumber=Journal.Firmnumber and Ledger.Voucher=Journal.Jvnumber and Ledger.nFinancialyear=Journal.nFinancialyear Where Ledger.Firmnumber='NBS-000001' and Ledger.nFinancialyear=2024 and (Ledger.Oowncode='R2030002') and Ledger.Branchcode='495' and Ledger.Dtoftran>=to_date('01/04/2023','dd/mm/yyyy') and Ledger.Dtoftran<=to_date('31/03/2024','dd/mm/yyyy') and Journal.nEntrytype!=1 group by Ledger.Oowncode ), tbltempportalloc as (Select Coalesce(tblFinledger.cClientcode,tblPortcashfin.cClientcode) as cClientcode, '27' as cRowindicator, Sum(Nvl(tblFinledger.nFiramount,0)+Nvl(tblPortcashfin.nFiramount,0)) as nFiramount, 0 as nSecamount From tblFinledger tblFinledger Full Outer Join tblPortcashfin On tblFinledger.cClientcode=tblPortcashfin.cClientcode and tblFinledger.cRowindicator=tblPortcashfin.cRowindicator Where (tblFinledger.cRowindicator='26' or tblPortcashfin.cRowindicator='25') group by Coalesce(tblFinledger.cClientcode,tblPortcashfin.cClientcode) ), tbltemptotdays as (Select '18' as cRowindicator, (to_date('31/03/2024','dd/mm/yyyy') - to_date('01/04/2024','dd/mm/yyyy'))+1 as nSecamount From dual ), tblFinalloop as (Select tblReportdesc.cRowindicator as cRowindicator, tblReportdesc.cRowdesc as cRowdesc, Coalesce(tblReportdesc.cClientcode,tblOpenstk.cClientcode,tblCapinout.cClientcode,tblPortcashfin.cClientcode,tblPortderfin.cClientcode,tblCashplusderfinal.cClientcode,tblDividend.cClientcode,tbltmpbillcharges.cClientcode,tbltmpbillchgtotal.cClientcode,tblMiscentries.cClientcode,tblFinledger.cClientcode,tbltempPortalloc.cClientcode,tblDirectdividend.cClientcode) as cClientcode, Coalesce(tblOpenstk.nFiramount,tblCapinout.nFiramount,tblPortcashfin.nFiramount,tblPortderfin.nFiramount,tblCashplusderfinal.nFiramount,tblDividend.nFiramount,tbltmpBillcharges.nFiramount,tbltmpbillchgtotal.nFiramount,tblMiscentries.nFiramount,tblFinledger.nFiramount,tbltempPortalloc.nFiramount,tblDirectdividend.nFiramount) as nFiramount, Coalesce(tblOpenstk.nSecamount,tblCapinout.nSecamount,tblPortcashfin.nSecamount,tblPortderfin.nSecamount,tblCashplusderfinal.nSecamount,tblDividend.nSecamount,tbltmpBillcharges.nSecamount,tbltmpBillchgtotal.nSecamount,tblMiscentries.nSecamount,tblFinledger.nSecamount,tbltempPortalloc.nSecamount,tbltempTotdays.nSecamount,tbltempTotdays.nSecamount) as nSecamount From tblReportdesc tblReportdesc Left Outer Join tblOpenstk On tblReportdesc.cRowindicator=tblOpenstk.cRowindicator and tblReportdesc.cClientcode=tblOpenstk.cClientcode Left Outer Join tblCapinout On tblReportdesc.cRowindicator=tblCapinout.cRowindicator and tblReportdesc.cClientcode=tblCapinout.cClientcode Left Outer Join tblPortcashfin On tblReportdesc.cRowindicator=tblPortcashfin.cRowindicator and tblReportdesc.cClientcode=tblPortcashfin.cClientcode Left Outer Join tblPortderfin On tblReportdesc.cRowindicator=tblPortderfin.cRowindicator and tblReportdesc.cClientcode=tblPortderfin.cClientcode Left Outer Join tblCashplusderfinal On tblReportdesc.cRowindicator=tblCashplusderfinal.cRowindicator and tblReportdesc.cClientcode=tblCashplusderfinal.cClientcode Left Outer Join tblDividend On tblReportdesc.cRowindicator=tblDividend.cRowindicator and tblReportdesc.cClientcode=tblDividend.cClientcode Left Outer Join tbltmpBillcharges On tblReportdesc.cRowindicator=tbltmpBillcharges.cRowindicator and tblReportdesc.cClientcode=tbltmpBillcharges.cClientcode Left Outer Join tbltmpbillchgtotal On tblReportdesc.cRowindicator=tbltmpBillchgtotal.cRowindicator and tblReportdesc.cClientcode=tbltmpBillchgtotal.cClientcode Left Outer Join tblMiscentries On tblReportdesc.cRowindicator=tblMiscentries.cRowindicator and tblReportdesc.cClientcode=tblMiscentries.cClientcode Left Outer Join tblFinledger On tblReportdesc.cRowindicator=tblFinledger.cRowindicator and tblReportdesc.cClientcode=tblFinledger.cClientcode Left Outer Join tbltempPortalloc On tblReportdesc.cRowindicator=tbltempPortalloc.cRowindicator and tblReportdesc.cClientcode=tbltempPortalloc.cClientcode Left Outer Join tblDirectdividend On tblReportdesc.cRowindicator=tblDirectdividend.cRowindicator and tblReportdesc.cClientcode=tblDirectdividend.cClientcode Left Outer Join tbltemptotdays On tblReportdesc.cRowindicator=tbltempTotdays.cRowindicator ), tbltempporttotal as ( Select '17' as cRowindicator, tblFinalloop.cClientcode as cClientcode, Sum(tblFinalloop.nSecamount) as nTotalamount From tblFinalloop Where tblFinalloop.cRowindicator!='18' and nvl(trim(tblFinalloop.cClientcode),' ')!=' ' group by tblFinalloop.cClientcode ), tbltemptotalcapital as ( Select tblFinalloop.cClientcode as cClientcode, Sum(tblFinalloop.nSecamount) as nTotalamount From tblFinalloop tblFinalloop Where (tblFinalloop.cRowindicator='02' or tblFinalloop.cRowindicator='01') and nvl(trim(tblFinalloop.cClientcode),' ')!=' ' group by tblFinalloop.cClientcode ) Select tblFinalloop.cRowindicator as cRowindicator, tblFinalloop.cRowdesc as cRowdesc, tblFinalloop.cClientcode as cClientcode, tblFinalloop.nFiramount as nFiramount, Case When (tblFinalloop.cRowindicator=25 or tblFinalloop.cRowindicator=26) and tbltempPortalloc.nFiramount!=0 then Round(tblFinalloop.nFiramount/tbltempPortalloc.nFiramount*100,2) When tblFInalloop.cRowindicator='17' then tbltempporttotal.nTotalamount When tblFinalloop.cRowindicator='19' and tbltemptotalcapital.nTotalamount!=0 then Round((tbltempporttotal.nTotalamount-tbltemptotalcapital.nTotalamount)*100/tbltemptotalcapital.nTotalamount,2) When tblFinalloop.cRowindicator='20' and tbltemptotalcapital.nTotalamount!=0 then Round(((tbltempporttotal.nTotalamount-tbltemptotalcapital.nTotalamount)*100/tbltemptotalcapital.nTotalamount)*365/ ((to_date('31/03/2024','dd/mm/yyyy') - to_date('01/04/2024','dd/mm/yyyy')+1)),2) else tblFinalloop.nSecamount end as nSecamount From tblFinalloop Left Outer Join tbltempportalloc On tblFinalloop.cClientcode=tbltempportalloc.cClientcode Left Outer Join tbltempporttotal On tblFinalloop.cClientcode=tbltempporttotal.cClientcode Left Outer Join tbltemptotalcapital On tblFinalloop.cClientcode=tbltemptotalcapital.cClientcode Order by 1 Title : 01~Error Description : ORA-01476: divisor is equal to zero Method : getglobalportfolioLine : 44015 Message : getGlobalportfolio StackTrace : at OracleInternal.ServiceObjects.OracleConnectionImpl.VerifyExecution(Int32& cursorId, Boolean bThrowArrayBindRelatedErrors, SqlStatementType sqlStatementType, Int32 arrayBindCount, OracleException& exceptionForArrayBindDML, Boolean& hasMoreRowsInDB, Boolean bFirstIterationDone) at OracleInternal.ServiceObjects.OracleCommandImpl.ExecuteReader(String commandText, OracleParameterCollection paramColl, CommandType commandType, OracleConnectionImpl connectionImpl, OracleDataReaderImpl& rdrImpl, Int32 longFetchSize, Int64 clientInitialLOBFS, OracleDependencyImpl orclDependencyImpl, Int64[] scnForExecution, Int64[]& scnFromExecution, OracleParameterCollection& bindByPositionParamColl, Boolean& bBindParamPresent, Int64& internalInitialLOBFS, OracleException& exceptionForArrayBindDML, OracleConnection connection, OracleLogicalTransaction& oracleLogicalTransaction, IEnumerable`1 adrianParsedStmt, Boolean isDescribeOnly, Boolean isFromEF) at Oracle.ManagedDataAccess.Client.OracleCommand.ExecuteReader(Boolean requery, Boolean fillRequest, CommandBehavior behavior) at Oracle.ManagedDataAccess.Client.OracleDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable) at clientlevel.Thinclientlevel.Clientlogin.getglobalportfolio(DateTime tdStartdate, DateTime tdEnddate, DateTime tdPoadate, DateTime tdFinancialstartdate, Int32 tnAngleselection, String tcClientfilter, Cliole loLdcommon) in File25:line 44015 Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 749821952 Shut down : N Username : MOBBO Date/Time : 17/05/2024 11:31:02 PM Connection : Closed =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : R2030002 With tbltempReport as (Select '01' as cRowindicator, 'Opening Market Value' as cRowdesc From Dual Union All Select '02' as cRowindicator, 'Capital In(+)/Out(-)' as cRowdesc From Dual Union All Select '03' as cRowindicator, Rpad(' ',8)||'Realized Profit (+)/(-)' as cRowdesc From dual Union All Select '04' as cRowindicator, 'Cash Segment' as cRowdesc From dual Union All Select '05' as cRowindicator, 'Derivatives Segment' as cRowdesc From dual Union All Select '06' as cRowindicator, 'Total Realized Profit(+)/(-) ' as cRowdesc From dual Union All Select '07' as cRowindicator, Rpad(' ',8)||'Un-Realized Profit (+)/(-) ' as cRowdesc From dual Union All Select '08' as cRowindicator, 'Cash Segment' as cRowdesc From dual Union All Select '09' as cRowindicator, 'Derivatives Segment' as cRowdesc From dual Union All Select '10' as cRowindicator, 'Total Un-Realized Profit(+)/(-) ' as cRowdesc From dual Union All Select '11' as cRowindicator, 'Total Dividend Amount' as cRowdesc From dual Union All Select '12' as cRowindicator, Rpad(' ',8)||'Statutory Charges' as cRowdesc From dual Union All Select '13' as cRowindicator, 'Cash Segment' as cRowdesc From dual Union All Select '14' as cRowindicator, 'Derivatives Segment' as cRowdesc From dual Union All Select '15' as cRowindicator, 'Misc. JV Entries' as cRowdesc From dual Union All Select '16' as cRowindicator, 'Direct Dividend Credit' as cRowdesc From dual Union All Select '17' as cRowindicator, 'Total Portfolio Allocation' as cRowdesc From dual Union All Select '18' as cRowindicator, 'Total No. of Days' as cRowdesc From dual Union All Select '19' as cRowindicator, 'Absolute Return' as cRowdesc From dual Union All Select '20' as cRowindicator, 'Annualized Return' as cRowdesc From dual Union All Select '24' as cRowindicator, Rpad(' ',8)||'Portfolio Allocation' as cRowdesc From dual Union All Select '25' as cRowindicator, 'Equity' as cRowdesc From dual Union All Select '26' as cRowindicator, 'Cash and Equivalent' as cRowdesc From dual Union All Select '27' as cRowindicator, 'Total Portfolio Allocation' as cRowdesc From dual ), tblReportdesc as (Select Ldfibs.Oowncode as cClientcode, tbltempReport.* From Ldfibs Ldfibs Left Outer Join tbltempReport On 1=1 Where Ldfibs.Firmnumber='NBS-000001' and (Ldfibs.Oowncode='R2030002') and Ldfibs.Brcode='495' ), tblOpendet as (Select Ledger.Oowncode as cClientcode, '01' as cRowindicator, Sum(Ledger.Damount-Ledger.Camount)*-1 as nSecamount From Ledger Ledger Where Ledger.Firmnumber='NBS-000001' and Ledger.nFinancialyear=2024 and (Ledger.Oowncode='R2030002') and Ledger.Branchcode='495' and Substr(Ledger.Voucher,1,4)='OPNG' group by Ledger.Oowncode Union All Select Sauda.Oowncode as cClientcode, '01' as cRowindicator, Sum(Sauda.Quantity*Sauda.Market) as nSecamount From Sauda Sauda Where Sauda.Egroup='OK' and Sauda.Firmnumber = 'NBS-000001' and (Sauda.Oowncode='R2030002') and Sauda.Brcode='495' group by Sauda.Oowncode ), tblOpenstk as (Select tblOpendet.cClientcode as cClientcode, Max(tblOpendet.cRowindicator) as cRowindicator, 0 as nFiramount, Sum(tblOpendet.nSecamount) as nSecamount From tblOpendet tblOpendet group by tblOpendet.cClientcode), tblCapinout as (Select Ledger.Oowncode as cClientcode, '02' as cRowindicator, 0 as nFiramount, Sum(Ledger.Damount-Ledger.Camount)*-1 as nSecamount From Ledger Ledger Where Ledger.Firmnumber='NBS-000001' and Ledger.nFinancialyear=2024 and (Ledger.Oowncode='R2030002') and Ledger.Branchcode='495' and Ledger.Dtoftran>=to_date('01/04/2023','dd/mm/yyyy') and Ledger.Dtoftran<=to_date('31/03/2024','dd/mm/yyyy') and (Substr(Ledger.Voucher,1,2)='RE' or Substr(Ledger.Voucher,1,2)='PY') group by Ledger.Oowncode ), tblFinledger as (Select Ledger.Oowncode as cClientcode, '26' as cRowindicator, Sum(Ledger.Damount-Ledger.Camount)*-1 as nFiramount, 0 as nSecamount From Ledger Ledger Where Ledger.Firmnumber='NBS-000001' and Ledger.nFinancialyear=2024 and (Ledger.Oowncode='R2030002') and Ledger.Branchcode='495' and Ledger.Dtoftran>=to_date('01/04/2023','dd/mm/yyyy') and Ledger.Dtoftran<=to_date('31/03/2024','dd/mm/yyyy') group by Ledger.Oowncode ), tblCashinternal as (Select Sauda.Oowncode as cClientcode, Sauda.Compcode as cScripcode, Sauda.Dtoftran as dBuydate, Sauda.BuySell as cBuysell, Sum(Sauda.Quantity) as nBuyquantity, Case When Sum(Sauda.Brokpercontract) = 0 Then Avg(Sauda.Final_Rat1) Else Case When Sauda.BuySell = 'B' Then Round(((Sum(Sauda.Quantity) * Avg(Sauda.Final_Rat1)) + Sum(Sauda.Brokpercontract)) / Sum(Sauda.Quantity), 10) Else Round(((Sum(Sauda.Quantity) * Avg(Sauda.Final_Rat1)) - Sum(Sauda.Brokpercontract)) / Sum(Sauda.Quantity), 10) End End as nBuynetrate, Sum(Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, Sauda.Quantity * -1))) Over(Partition By Sauda.Oowncode, Sauda.Compcode Order By Sauda.Dtoftran, Sauda.Final_Rat1 rows between current row and unbounded following) as nRunningqty, Sum(Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, 0))) Over(Partition By Sauda.Oowncode, Sauda.Compcode Order By Sauda.Dtoftran, Sauda.Final_Rat1 rows between current row and unbounded following) as nRunningbuytotal, Sum(Sum(Decode(Sauda.Buysell, 'S', Sauda.Quantity, 0))) Over(Partition By Sauda.Oowncode, Sauda.Compcode Order By Sauda.Dtoftran, Sauda.Final_Rat1 rows between current row and unbounded following) as nRunningselltotal, Sum(Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, 0))) Over(Partition By Sauda.Oowncode, Sauda.Compcode) as nSummarybuy, Sum(Sum(Decode(Sauda.Buysell, 'S', Sauda.Quantity, 0))) Over(Partition By Sauda.Oowncode, Sauda.Compcode) as nSummarysell, Sum(Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, 0)) * Case When Sum(Sauda.Brokpercontract) = 0 Then Avg(Sauda.Final_Rat1) Else Case When Sauda.BuySell = 'B' Then Round(((Sum(Sauda.Quantity) * Avg(Sauda.Final_Rat1)) + Sum(Sauda.Brokpercontract)) / Sum(Sauda.Quantity), 10) Else 0 End End) Over(Partition By Sauda.Oowncode, Sauda.Compcode) as nSumBuyamount, Sum(Sum(Decode(Sauda.Buysell, 'S', Sauda.Quantity, 0)) * Case When Sum(Sauda.Brokpercontract) = 0 Then Avg(Sauda.Final_Rat1) Else Case When Sauda.BuySell = 'B' Then 0 Else Round(((Sum(Sauda.Quantity) * Avg(Sauda.Final_Rat1)) - Sum(Sauda.Brokpercontract)) / Sum(Sauda.Quantity), 10) End End) Over(Partition By Sauda.Oowncode, Sauda.Compcode) as nSumSellamount, Sum(Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, Sauda.Quantity * -1))) Over(Partition By Sauda.Oowncode, Sauda.Compcode) As nNetquantity From Sauda Sauda Where Sauda.Firmnumber='NBS-000001' and Sauda.Egroup!='YC' and Sauda.Egroup != 'LB' and Sauda.Egroup != 'SR' and Sauda.Egroup != 'LA' and Sauda.Sterminal != '99999' and Sauda.Dtoftran 0 Then Case When tblCashinternal.nRunningbuytotal > tblCashinternal.nNetquantity Then tblCashinternal.nNetquantity + tblCashinternal.nBuyquantity - tblCashinternal.nRunningbuytotal Else tblCashinternal.nBuyquantity End When tblCashinternal.nNetquantity < 0 Then Case When Abs(tblCashinternal.nRunningselltotal) > Abs(tblCashinternal.nNetquantity) Then tblCashinternal.nNetquantity - tblCashinternal.nBuyquantity + tblCashinternal.nRunningselltotal Else tblCashinternal.nBuyquantity * -1 End End) as nOpStockquantity, Sum((Case When tblCashinternal.nNetquantity = 0 Then 0 When tblCashinternal.nNetquantity > 0 Then Case When tblCashinternal.nRunningbuytotal > tblCashinternal.nNetquantity Then tblCashinternal.nNetquantity + tblCashinternal.nBuyquantity - tblCashinternal.nRunningbuytotal Else tblCashinternal.nBuyquantity End When tblCashinternal.nNetquantity < 0 Then Case When Abs(tblCashinternal.nRunningselltotal) > Abs(tblCashinternal.nNetquantity) Then tblCashinternal.nNetquantity - tblCashinternal.nBuyquantity + tblCashinternal.nRunningselltotal Else tblCashinternal.nBuyquantity * -1 End End) * tblCashinternal.nBuynetrate) as nOpStockAmount from tblCashinternal Where (tblCashinternal.nNetquantity > 0 And tblCashinternal.cBuysell = 'B' And tblCashinternal.nRunningbuytotal <= tblCashinternal.nNetquantity + tblCashinternal.nBuyquantity) or (tblCashinternal.nNetquantity < 0 and tblCashinternal.cBuysell = 'S' and Abs(tblCashinternal.nRunningselltotal) <= Abs(tblCashinternal.nNetquantity) + tblCashinternal.nBuyquantity) Group By tblCashinternal.cClientcode, tblCashinternal.cScripcode), tblCashinternal1 as (Select Sauda.Oowncode as cClientcode, Sauda.Compcode as cScripcode, Sauda.Dtoftran as dBuydate, Sauda.BuySell as cBuysell, Sum(Sauda.Quantity) as nBuyquantity, Case When Sum(Sauda.Brokpercontract) = 0 Then Avg(Sauda.Final_Rat1) Else Case When Sauda.BuySell = 'B' Then Round(((Sum(Sauda.Quantity) * Avg(Sauda.Final_Rat1)) + Sum(Sauda.Brokpercontract)) / Sum(Sauda.Quantity), 10) Else Round(((Sum(Sauda.Quantity) * Avg(Sauda.Final_Rat1)) - Sum(Sauda.Brokpercontract)) / Sum(Sauda.Quantity), 10) End End as nBuynetrate, Sum(Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, Sauda.Quantity * -1))) Over(Partition By Sauda.Oowncode, Sauda.Compcode Order By Sauda.Dtoftran, Sauda.Final_Rat1 rows between current row and unbounded following) as nRunningqty, Sum(Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, 0))) Over(Partition By Sauda.Oowncode, Sauda.Compcode Order By Sauda.Dtoftran, Sauda.Final_Rat1 rows between current row and unbounded following) as nRunningbuytotal, Sum(Sum(Decode(Sauda.Buysell, 'S', Sauda.Quantity, 0))) Over(Partition By Sauda.Oowncode, Sauda.Compcode Order By Sauda.Dtoftran, Sauda.Final_Rat1 rows between current row and unbounded following) as nRunningselltotal, Sum(Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, 0))) Over(Partition By Sauda.Oowncode, Sauda.Compcode) as nSummarybuy, Sum(Sum(Decode(Sauda.Buysell, 'S', Sauda.Quantity, 0))) Over(Partition By Sauda.Oowncode, Sauda.Compcode) as nSummarysell, Sum(Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, 0)) * Case When Sum(Sauda.Brokpercontract) = 0 Then Avg(Sauda.Final_Rat1) Else Case When Sauda.BuySell = 'B' Then Round(((Sum(Sauda.Quantity) * Avg(Sauda.Final_Rat1)) + Sum(Sauda.Brokpercontract)) / Sum(Sauda.Quantity), 10) Else 0 End End) Over(Partition By Sauda.Oowncode, Sauda.Compcode) as nSumBuyamount, Sum(Sum(Decode(Sauda.Buysell, 'S', Sauda.Quantity, 0)) * Case When Sum(Sauda.Brokpercontract) = 0 Then Avg(Sauda.Final_Rat1) Else Case When Sauda.BuySell = 'B' Then 0 Else Round(((Sum(Sauda.Quantity) * Avg(Sauda.Final_Rat1)) - Sum(Sauda.Brokpercontract)) / Sum(Sauda.Quantity), 10) End End) Over(Partition By Sauda.Oowncode, Sauda.Compcode) as nSumSellamount, Sum(Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, Sauda.Quantity * -1))) Over(Partition By Sauda.Oowncode, Sauda.Compcode) As nNetquantity From Sauda Sauda Where Sauda.Firmnumber='NBS-000001' and Sauda.Egroup!='YC' and Sauda.Egroup != 'LB' and Sauda.Egroup != 'SR' and Sauda.Egroup != 'LA' and Sauda.Sterminal != '99999' and Sauda.Dtoftran<=to_date('31/03/2024','dd/mm/yyyy') and Sauda.Brcode='495' and (Sauda.Oowncode='R2030002') group by Sauda.Oowncode, Sauda.Dtoftran, Sauda.Final_Rat1, Sauda.buysell, Sauda.Compcode), tblClosing as (Select tblCashinternal1.cClientcode as cClientcode, tblCashinternal1.cScripcode as cScripcode, Sum(Case When tblCashinternal1.nNetquantity = 0 Then 0 When tblCashinternal1.nNetquantity > 0 Then Case When tblCashinternal1.nRunningbuytotal > tblCashinternal1.nNetquantity Then tblCashinternal1.nNetquantity + tblCashinternal1.nBuyquantity - tblCashinternal1.nRunningbuytotal Else tblCashinternal1.nBuyquantity End When tblCashinternal1.nNetquantity < 0 Then Case When Abs(tblCashinternal1.nRunningselltotal) > Abs(tblCashinternal1.nNetquantity) Then tblCashinternal1.nNetquantity - tblCashinternal1.nBuyquantity + tblCashinternal1.nRunningselltotal Else tblCashinternal1.nBuyquantity * -1 End End) AS nCLStockquantity, Sum((Case When tblCashinternal1.nNetquantity = 0 Then 0 When tblCashinternal1.nNetquantity > 0 Then Case When tblCashinternal1.nRunningbuytotal > tblCashinternal1.nNetquantity Then tblCashinternal1.nNetquantity + tblCashinternal1.nBuyquantity - tblCashinternal1.nRunningbuytotal Else tblCashinternal1.nBuyquantity End When tblCashinternal1.nNetquantity < 0 Then Case When Abs(tblCashinternal1.nRunningselltotal) > Abs(tblCashinternal1.nNetquantity) Then tblCashinternal1.nNetquantity - tblCashinternal1.nBuyquantity + tblCashinternal1.nRunningselltotal Else tblCashinternal1.nBuyquantity * -1 End End) * tblCashinternal1.nBuynetrate) as nClStockAmount from tblCashinternal1 Where (tblCashinternal1.nNetquantity > 0 And tblCashinternal1.cBuysell = 'B' And tblCashinternal1.nRunningbuytotal <= tblCashinternal1.nNetquantity + tblCashinternal1.nBuyquantity) or (tblCashinternal1.nNetquantity < 0 and tblCashinternal1.cBuysell = 'S' and Abs(tblCashinternal1.nRunningselltotal) <= Abs(tblCashinternal1.nNetquantity) + tblCashinternal1.nBuyquantity) Group By tblCashinternal1.cClientcode, tblCashinternal1.cScripcode), tblBuYSell as (Select Sauda.Oowncode as cClientcode, Sauda.Compcode as cScripcode, Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, 0)) as nbuyQty, Sum(Decode(Sauda.Buysell, 'S', Sauda.Quantity, 0)) as nsellQty, Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity * Sauda.Final_Rat1 , 0)+Case When Sauda.Buysell='B' then Sauda.Brokpercontract else 0 end) as nBuyamount, Sum(Decode(Sauda.Buysell, 'S', Sauda.Quantity * Sauda.Final_Rat1 , 0)-Case When Sauda.Buysell='S' then Sauda.Brokpercontract else 0 end) as nSellamount From Sauda Sauda Where Sauda.Firmnumber='NBS-000001' and Sauda.Egroup!='YC' and Sauda.Egroup != 'LB' and Sauda.Egroup != 'SR' and Sauda.Egroup != 'LA' and Sauda.Sterminal != '99999' and Sauda.Dtoftran>=to_date('01/04/2023','dd/mm/yyyy') and Sauda.Dtoftran<=to_Date('31/03/2024','dd/mm/yyyy') and Sauda.Brcode='495' and (Sauda.Oowncode='R2030002') group by Sauda.Oowncode, Sauda.Compcode), tblCashcost as (Select Coalesce(tblOpening.cClientcode,tblClosing.cClientcode,tblBuysell.cClientcode) as cClientcode, Coalesce(tblOpening.cScripcode,tblClosing.cScripcode,tblBuysell.cScripcode) as cScripcode, Nvl(tblOpening.nOpstockquantity,0) as nOpstockquantity, Nvl(tblOpening.nOpstockamount,0) as nOpstockamount, Case When Nvl(tblOpening.nOpstockquantity,0)!=0 then Round(Nvl(tblOpening.nOpstockamount,0)/Nvl(tblOpening.nOpstockquantity,0),4) else 0 end as nOpstockavg, Nvl(tblBuysell.nBuyqty,0) as nPrePurchqty, Nvl(tblBuysell.nBuyamount,0) as nPrePurchvalue, Case When Nvl(tblBuysell.nBuyqty,0) !=0 then Round(Nvl(tblBuysell.nBuyamount,0)/Nvl(tblBuysell.nBuyqty,0),4) else 0 end as nPrePurchavg, Nvl(tblBuysell.nSellQty, 0) as nPreSellqty, Nvl(tblBuysell.nSellamount, 0) as nPreSellvalue, Case When Nvl(tblBuysell.nSellQty, 0) != 0 then Round(Nvl(tblBuysell.nSellamount, 0) / Nvl(tblBuysell.nSellQty, 0), 4) else 0 end as nPreSellavg, Least((Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockquantity, 0) + Nvl(tblBuysell.nBuyqty, 0) Else Nvl(tblBuysell.nBuyqty, 0) End), (Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockquantity, 0)) + Nvl(tblBuysell.nSellqty, 0) Else Nvl(tblBuysell.nSellqty, 0) End)) as nPurchqty, Round((Case When (Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockquantity, 0) + Nvl(tblBuysell.nBuyqty, 0) Else Nvl(tblBuysell.nBuyqty, 0) End) <= (Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockquantity, 0)) + Nvl(tblBuysell.nSellqty, 0) Else Nvl(tblBuysell.nSellqty, 0) End) Then Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockAmount, 0) + Nvl(tblBuysell.nBuyAmount, 0) Else Nvl(tblBuysell.nBuyAmount, 0) End Else Nvl(tblBuysell.nBuyAmount, 0) + Nvl(tblOpening.nOpstockAmount, 0) - nvl(tblClosing.nClStockAmount, 0) End), 2) as nPurchvalue, Round((Case When Least((Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockquantity, 0) + Nvl(tblBuysell.nBuyqty, 0) Else Nvl(tblBuysell.nBuyqty, 0) End), (Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockquantity, 0)) + Nvl(tblBuysell.nSellqty, 0) Else Nvl(tblBuysell.nSellqty, 0) End)) != 0 Then (Case When (Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockquantity, 0) + Nvl(tblBuysell.nBuyqty, 0) Else Nvl(tblBuysell.nBuyqty, 0) End) <= (Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockquantity, 0)) + Nvl(tblBuysell.nSellqty, 0) Else Nvl(tblBuysell.nSellqty, 0) End) Then Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockAmount, 0) + Nvl(tblBuysell.nBuyAmount, 0) Else Nvl(tblBuysell.nBuyAmount, 0) End Else Nvl(tblBuysell.nBuyAmount, 0) + Nvl(tblOpening.nOpstockAmount, 0) - nvl(tblClosing.nClStockAmount, 0) End) / (Least((Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockquantity, 0) + Nvl(tblBuysell.nBuyqty, 0) Else Nvl(tblBuysell.nBuyqty, 0) End), (Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockquantity, 0)) + Nvl(tblBuysell.nSellqty, 0) Else Nvl(tblBuysell.nSellqty, 0) End))) Else 0 End), 4) as nPurchavg, Least((Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockquantity, 0) + Nvl(tblBuysell.nBuyqty, 0) Else Nvl(tblBuysell.nBuyqty, 0) End), (Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockquantity, 0)) + Nvl(tblBuysell.nSellqty, 0) Else Nvl(tblBuysell.nSellqty, 0) End)) as nSalesqty, Round((Case When (Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockquantity, 0) + Nvl(tblBuysell.nBuyqty, 0) Else Nvl(tblBuysell.nBuyqty, 0) End) >= (Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockquantity, 0)) + Nvl(tblBuysell.nSellqty, 0) Else Nvl(tblBuysell.nSellqty, 0) End) Then Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockAmount, 0)) + Nvl(tblBuysell.nSellAmount, 0) Else Nvl(tblBuysell.nSellAmount, 0) End Else Nvl(tblBuysell.nSellAmount, 0) - Nvl(tblOpening.nOpstockAmount, 0) + nvl(tblClosing.nClStockAmount, 0) End), 2) as nSalesvalue, Round((Case When Least((Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockquantity, 0) + Nvl(tblBuysell.nBuyqty, 0) Else Nvl(tblBuysell.nBuyqty, 0) End), (Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockquantity, 0)) + Nvl(tblBuysell.nSellqty, 0) Else Nvl(tblBuysell.nSellqty, 0) End)) != 0 Then (Case When (Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockquantity, 0) + Nvl(tblBuysell.nBuyqty, 0) Else Nvl(tblBuysell.nBuyqty, 0) End) >= (Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockquantity, 0)) + Nvl(tblBuysell.nSellqty, 0) Else Nvl(tblBuysell.nSellqty, 0) End) Then Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockAmount, 0)) + Nvl(tblBuysell.nSellAmount, 0) Else Nvl(tblBuysell.nSellAmount, 0) End Else Nvl(tblBuysell.nSellAmount, 0) - Nvl(tblOpening.nOpstockAmount, 0) + nvl(tblClosing.nClStockAmount, 0) End) / (Least((Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockquantity, 0) + Nvl(tblBuysell.nBuyqty, 0) Else Nvl(tblBuysell.nBuyqty, 0) End), (Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockquantity, 0)) + Nvl(tblBuysell.nSellqty, 0) Else Nvl(tblBuysell.nSellqty, 0) End))) ELse 0 End), 4) as nSalesavg, Nvl(tblClosing.nClstockquantity, 0) as nOsstock, Nvl(tblClosing.nClstockamount, 0) as nOsstockvalue, Case When Nvl(tblClosing.nClstockquantity, 0) != 0 then Round(Nvl(tblClosing.nClstockamount, 0) / Nvl(tblClosing.nClstockquantity, 0), 4) else 0 end as nOsstockavg, (nvl(tblBuySell.nSellAmount, 0) - nvl(tblOpening.nOpStockAmount, 0) - nvl(tblBuySell.nBuyAmount, 0) + nvl(tblClosing.nClStockAmount, 0)) as nProfitloss, ((Market.Market * nvl(tblClosing.nClstockquantity, 0)) - Nvl(tblClosing.nClstockamount, 0)) As nUnrealprlo, (nvl(tblBuySell.nSellAmount, 0) - nvl(tblOpening.nOpStockAmount, 0) - nvl(tblBuySell.nBuyAmount, 0) + nvl(tblClosing.nClStockAmount, 0)) + ((Market.Market * nvl(tblClosing.nClstockquantity, 0)) - Nvl(tblClosing.nClstockamount, 0)) As nOverallprlo, Market.Market as nMarketrate, Market.Market*Nvl(tblClosing.nClstockquantity,0) As nMarketvalue from tblOPening tblOpening Full Join TblClosing on tblOpening.cclientcode = tblclosing.cclientcode and tblOPening.cScripcode = tblClosing.cScripcode Full Join TblBuySell on tblBuySell.cclientcode = coalesce(tblOpening.cclientcode, tblclosing.cclientcode) and tblBuySell.cScripcode = coalesce(tblOPening.cScripcode, tblClosing.cScripcode) Left Outer Join Market Market On Market.Firmnumber='NBS-000001' and Market.code=coalesce(tblOpening.cScripcode, tblclosing.cScripcode, tblBuysell.cScripcode) ), tblOpendet as (Select Ledger.Oowncode as cClientcode, '01' as cRowindicator, Sum(Ledger.Damount-Ledger.Camount)*-1 as nSecamount From Ledger Ledger Where Ledger.Firmnumber='NBS-000001' and Ledger.nFinancialyear = 2024 and (Ledger.Oowncode='R2030002') and Ledger.Branchcode='495' and Substr(Ledger.Voucher,1,4)='OPNG' group by Ledger.Oowncode Union All Select tblCashcost.cClientcode as cClientcode, '01' as cRowindicator, Sum(tblCashcost.nOpstockamount) as nSecamount From tblCashcost tblCashcost group by tblCashcost.cClientcode ), tblOpenstk as (Select tblOpendet.cClientcode as cClientcode, Max(tblOpendet.cRowindicator) as cRowindicator, 0 as nFiramount, Sum(tblOpendet.nSecamount) as nSecamount From tblOpendet tblOpendet group by tblOpendet.cClientcode), tblPortcashfin as (Select tblCashcost.cClientcode as cClientcode, '04' as cRowindicator, Sum(tblCashcost.nProfitloss) as nFiramount, 0 as nSecamount From tblCashcost tblCashcost group by tblCashcost.cClientcode Union All Select tblCashcost.cClientcode as cClientcode, '25' as cRowindicator, Sum(tblCashcost.nMarketvalue) as nFiramount, 0 as nSecamount From tblCashcost tblCashcost group by tblCashcost.cClientcode Union All Select tblCashcost.cClientcode as cClientcode, '08' as cRowindicator, Sum(tblCashcost.nUnrealprlo) as nFiramount, 0 as nSecamount From tblCashcost tblCashcost group by tblCashcost.cClientcode ), tblFointernal as (Select Fosauda.Oowncode as cClientcode, Fosauda.Compcode as cScripcode, Fosauda.Strikeprice as nStrikeprice, Fosauda.Optiontype as cOptiontype, Company.Fibsacct as cScripname, Company.Expirydate as dExpirydate, Exchange.Operation as cOperation, Company.Instrutyp as cInstrutyp, Company.nBaseunit as nBaseunit, Company.cUnitofmeasurement as cUnitofmeasurement, Company.cUnitofTrading as cUnitofTrading, Company.nTradeablelot as nTradeablelot, Company.nPricenumerator as nPricenumerator, Company.nPricedenominator as nPricedenominator, Company.nGeneralnumerator as nGeneralnumerator, Company.nGeneraldenominator as nGeneraldenominator, Fosauda.Dtoftran as dBuydate, Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') or Fosauda.Optiontype != 'PO' Then Fosauda.Buysell else Case When Fosauda.Buysell = 'B' Then 'S' Else 'B' End end as cBuysell, Sum(Fosauda.quantity) as nBuyquantity, Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') Then Case When Sum(Fosauda.nValuebrokerage) = 0 then Avg(Fosauda.Final_Rat1) else Case When Fosauda.BuySell = 'B' Then Round(((Sum(Fosauda.Quantity) * Avg(Fosauda.Final_Rat1)) + Sum(Fosauda.nValuebrokerage)) / Sum(Fosauda.Quantity), 10) Else Round(((Sum(Fosauda.Quantity) * Avg(Fosauda.Final_Rat1)) - Sum(Fosauda.nValuebrokerage)) / Sum(Fosauda.Quantity), 10) End End Else Case When Fosauda.Buysell = 'B' Then Avg(Fosauda.Final_rat1) - Avg(Fosauda.Strikeprice) else Avg(Fosauda.Strikeprice) - Avg(Fosauda.Final_rat1) End End as nBuynetrate, Sum(Sum(Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') or Fosauda.Optiontype != 'PO' Then Decode(Fosauda.Buysell, 'B', Fosauda.Quantity, Fosauda.Quantity * -1) Else Decode(Fosauda.Buysell, 'S', Fosauda.Quantity, Fosauda.Quantity * -1) End)) Over(Partition By Fosauda.Oowncode, Company.Fibsacct, Fosauda.Strikeprice, Fosauda.Optiontype Order By Fosauda.Dtoftran, Fosauda.Final_Rat1 rows between current row and unbounded following) as nRunningqty, Sum(Sum(Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') or Fosauda.optiontype != 'PO' Then Decode(Fosauda.Buysell, 'B', Fosauda.Quantity, 0) Else Decode(Fosauda.Buysell, 'S', Fosauda.Quantity, 0) End)) Over(Partition By Fosauda.Oowncode, Company.Fibsacct, Fosauda.Strikeprice, Fosauda.Optiontype Order By Fosauda.Dtoftran, Fosauda.Final_Rat1 rows between current row and unbounded following) as nRunningbuytotal, Sum(Sum(Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') or Fosauda.Optiontype != 'PO' Then Decode(Fosauda.Buysell, 'S', Fosauda.Quantity, 0) Else Decode(Fosauda.Buysell, 'B', Fosauda.Quantity, 0) End)) Over(Partition By Fosauda.Oowncode, Company.Fibsacct, Fosauda.Strikeprice, Fosauda.Optiontype Order By Fosauda.Dtoftran, Fosauda.Final_Rat1 rows between current row and unbounded following) as nRunningselltotal, Sum(Sum(Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') or Fosauda.optiontype != 'PO' Then Decode(Fosauda.Buysell, 'B', Fosauda.Quantity, 0) Else Decode(Fosauda.Buysell, 'S', Fosauda.Quantity, 0) End)) Over(Partition By Fosauda.Oowncode, Company.Fibsacct, Fosauda.Strikeprice, Fosauda.Optiontype) as nSummarybuy, Sum(Sum(Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') or Fosauda.optiontype != 'PO' Then Decode(Fosauda.Buysell, 'S', Fosauda.Quantity, 0) Else Decode(Fosauda.Buysell, 'B', Fosauda.Quantity, 0) End)) Over(Partition By Fosauda.Oowncode, Company.Fibsacct, Fosauda.Strikeprice, Fosauda.Optiontype) as nSummarysell, Sum(Sum(Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') or Fosauda.Optiontype != 'PO' Then Decode(Fosauda.Buysell, 'B', Fosauda.Quantity, 0) Else Decode(Fosauda.Buysell, 'S', Fosauda.Quantity, 0) End) * Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') Then Case When Sum(Fosauda.nValuebrokerage) = 0 then Avg(Fosauda.Final_Rat1) else Case When Fosauda.BuySell = 'B' Then Round(((Sum(Fosauda.Quantity) * Avg(Fosauda.Final_Rat1)) + Sum(Fosauda.nValuebrokerage)) / Sum(Fosauda.Quantity), 10) Else Round(((Sum(Fosauda.Quantity) * Avg(Fosauda.Final_Rat1)) - Sum(Fosauda.nValuebrokerage)) / Sum(Fosauda.Quantity), 10) End End Else Abs(Avg(Fosauda.Final_Rat1) - Avg(fosauda.strikeprice)) End) Over(Partition By Fosauda.Oowncode, Company.Fibsacct, Fosauda.Strikeprice, Fosauda.Optiontype) as nSumBuyamount, Sum(Sum(Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') or Fosauda.Optiontype != 'PO' Then Decode(Fosauda.Buysell, 'S', Fosauda.Quantity, 0) Else Decode(Fosauda.Buysell, 'B', Fosauda.Quantity, 0) End) * Case When (Fosauda.saudatype != 'AS' and Fosauda.Saudatype != 'EX') Then Case When Sum(Fosauda.nValuebrokerage) = 0 then Avg(Fosauda.Final_Rat1) else Case When Fosauda.BuySell = 'B' Then Round(((Sum(Fosauda.Quantity) * Avg(Fosauda.Final_Rat1)) + Sum(Fosauda.nValuebrokerage)) / Sum(Fosauda.Quantity), 10) Else Round(((Sum(Fosauda.Quantity) * Avg(Fosauda.Final_Rat1)) - Sum(Fosauda.nValuebrokerage)) / Sum(Fosauda.Quantity), 10) End End Else Abs(Avg(Fosauda.Final_Rat1) - Avg(fosauda.strikeprice)) End) Over(Partition By Fosauda.Oowncode, Company.Fibsacct, Fosauda.Strikeprice, Fosauda.Optiontype) as nSumSellamount, Sum(Sum(Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') or Fosauda.optiontype != 'PO' Then Decode(Fosauda.Buysell, 'B', Fosauda.Quantity, Fosauda.Quantity * -1) Else Decode(Fosauda.Buysell, 'S', Fosauda.Quantity, Fosauda.Quantity * -1) End)) Over(Partition By Fosauda.Oowncode, Company.Fibsacct, Fosauda.Strikeprice, Fosauda.Optiontype) As nNetquantity From Fosauda Fosauda Inner Join Company Company On Fosauda.firmnumber = Company.Firmnumber and Fosauda.Compcode = Company.oowncode Inner Join Exchange Exchange On Fosauda.Firmnumber = Exchange.Firmnumber and Fosauda.Exchcode = Exchange.Code Where Fosauda.Firmnumber = 'NBS-000001' and Fosauda.Egroup != 'YF' and Fosauda.Egroup != 'LB' and Fosauda.Egroup != 'SR' and Fosauda.Egroup != 'LA' and Fosauda.Sterminal != '99999' and (Fosauda.Oowncode='R2030002') and Fosauda.Brcode='495' and Fosauda.Dtoftran>=to_date('01/04/2023','dd/mm/yyyy') and Fosauda.Dtoftran<=to_date('31/03/2024','dd/mm/yyyy') and ((Fosauda.Saudatype != 'B/' and Fosauda.Orignalno = 0) or (Fosauda.Saudatype = 'B/' and (Fosauda.Orignalno = -99 or Fosauda.Dtoftran=to_date('01/04/2023','dd/mm/yyyy')))) group by Fosauda.Oowncode, Company.Fibsacct, Company.Expirydate, Exchange.Operation, Company.Instrutyp, Company.nBaseunit, Company.cUnitofmeasurement, Company.cUnitofTrading, Company.nTradeablelot, Company.nPricenumerator, Company.nPricedenominator, Company.nGeneralnumerator, Company.nGeneraldenominator, Fosauda.Dtoftran, Fosauda.Final_Rat1, Fosauda.buysell, Fosauda.Compcode, Fosauda.Strikeprice, Fosauda.Saudatype, Fosauda.Optiontype), tblFocost as (Select tblFointernal.cClientcode as cClientcode, tblFointernal.cScripcode as cScripcode, tblFointernal.nStrikeprice as nStrikeprice, tblFointernal.cOptiontype as cOptiontype, tblFointernal.cScripname as cScripname, tblFointernal.cOperation as cOperation, tblFoInternal.cInstrutyp as cInstrutyp, tblFoInternal.nBaseunit as nBaseunit, tblFoInternal.cUnitofmeasurement as cUnitofmeasurement, tblFoInternal.cUnitofTrading as cUnitofTrading, tblFoInternal.nTradeablelot as nTradeablelot, tblFoInternal.nPricenumerator as nPricenumerator, tblFoInternal.nPricedenominator as nPricedenominator, tblFoInternal.nGeneralnumerator as nGeneralnumerator, tblFoInternal.nGeneraldenominator as nGeneraldenominator, tblFointernal.dExpirydate as dExpirydate, tblFointernal.dBuydate as dBuydate, tblFointernal.nBuynetrate as nBuynetrate, Case When tblFointernal.nNetquantity = 0 Then 0 When tblFointernal.nNetquantity > 0 Then Case When tblFointernal.nRunningbuytotal > tblFointernal.nNetquantity Then tblFointernal.nNetquantity + tblFointernal.nBuyquantity - tblFointernal.nRunningbuytotal Else tblFointernal.nBuyquantity End When tblFointernal.nNetquantity < 0 Then Case When abs(tblFointernal.nRunningselltotal) > abs(tblFointernal.nNetquantity) Then tblFointernal.nNetquantity - tblFointernal.nBuyquantity + tblFointernal.nRunningselltotal Else tblFointernal.nBuyquantity * -1 End End AS nStockquantity, tblFointernal.nSummarybuy as nSummarybuy, tblFointernal.nSumBuyamount as nSumbuyamount, tblFointernal.nSummarysell as nSummarysell, tblFointernal.nSumSellamount as nSumsellamount From tblFointernal tblFoInternal Where (tblFointernal.nNetquantity > 0 and tblFointernal.cBuysell = 'B' and tblFointernal.nRunningbuytotal <= tblFointernal.nNetquantity + tblFointernal.nBuyquantity) or (tblFointernal.nNetquantity < 0 and tblFointernal.cBuysell = 'S' and abs(tblFointernal.nRunningselltotal) <= Abs(tblFointernal.nNetquantity) + tblFointernal.nBuyquantity) or (tblFointernal.nNetquantity = 0 And tblFointernal.nRunningselltotal = tblFointernal.nSummarysell and tblFointernal.nRunningbuytotal = tblFointernal.nSummarybuy)), tblFinalcost as (Select tblFocost.cClientcode as cClientcode, tblFocost.cScripcode as cScripcode, tblFocost.nStrikeprice as nStrikeprice, tblFocost.cOptiontype as cOptiontype, tblFocost.dExpirydate as dExpirydate, tblFocost.cScripname as cScripname, tblFocost.cOperation as cOperation, tblFocost.cInstrutyp as cInstrutyp, tblFocost.nBaseunit as nBaseunit, tblFocost.cUnitofmeasurement as cUnitofmeasurement, tblFocost.cUnitofTrading as cUnitofTrading, tblFocost.nTradeablelot as nTradeablelot, tblFocost.nPricenumerator as nPricenumerator, tblFocost.nPricedenominator as nPricedenominator, tblFocost.nGeneralnumerator as nGeneralnumerator, tblFocost.nGeneraldenominator as nGeneraldenominator, tblFocost.nSummarybuy - (Case When Sum(tblFocost.nStockquantity) > 0 then Sum(tblFocost.nStockquantity) else 0 end) As nPurchqty, tblFocost.nSumbuyamount - (Case When Sum(tblFocost.nStockquantity) > 0 then Sum(tblFocost.nStockquantity * tblFocost.nBuyNetRate) else 0 end) As nPurchvalue, tblFocost.nSummarysell - (Case When Sum(tblFocost.nStockquantity) < 0 then Sum(Abs(tblFocost.nStockquantity)) else 0 end) as nSalesqty, tblFocost.nSumSellamount - (Case When Sum(tblFocost.nStockquantity) < 0 then Sum(Abs(tblFocost.nStockquantity) * tblFocost.nBuyNetRate) else 0 end) as nSalesvalue, Sum(tblFocost.nStockquantity) As nOsstock, Case When Sum(tblFocost.nStockquantity) != 0 then Round(Sum(tblFocost.nStockquantity * tblFocost.nBuyNetRate) / Sum(tblFocost.nStockquantity), 4) else 0 end as nOsstockavg, Sum(tblFocost.nStockquantity * tblFocost.nBuyNetRate) as nOsstockvalue, tblFocost.nSumSellamount + Sum(tblFocost.nStockquantity * tblFocost.nBuyNetRate) - tblFocost.nSumBuyamount as nProfitLoss, Max(Market.Market) as nMarketrate, Max(Market.Market) * Sum(tblFocost.nStockquantity) as nMarketvalue, ((tblFocost.nSumSellamount + Sum(tblFocost.nStockquantity * tblFocost.nBuyNetRate) - tblFocost.nSumBuyamount)) + ((Max(Market.Market) * Sum(tblFocost.nStockquantity)) - (Sum(tblFocost.nStockquantity * tblFocost.nBuyNetRate))) as nOverallprlo, Max(Market.nPrvcloseprice) as nPrvcloseprice, Max(Market.nHighprice) as nHighprice, Max(Market.nLowprice) as nLowprice, Max(Market.nLowercircuitLimit) as nLowercircuitlimit, Max(Market.nOpenprice) as nOpenprice, Max(Market.nUppercircuitlimit) as nUppercircuitlimit, Max(Market.nNoofTrades) as nNooftrades, Max(Market.nVoltradedToday) as nVoltradedtoday, Max(Market.nVolquantity) as nVolquantity, Max(Market.dLastupdatedate) as dlastupdatedate, Max(Market.n52Weeklow) as n52Weeklow, Max(Market.n52WeekHigh) as n52Weekhigh From tblFocost tblFocost Left Outer Join Market Market On Market.Firmnumber = 'NBS-000001' and tblFocost.cScripcode = Market.Code and tblFocost.nStrikeprice = Market.Strikeprice and tblFocost.cOptiontype = Market.Optiontype and ((Market.nOptmethod = 0 and tblFocost.nStrikeprice = 0) or (Market.nOptmethod = 1 and tblFocost.nStrikeprice != 0)) Group By tblFocost.cClientcode, tblFocost.cScripcode, tblFocost.cScripname, tblFocost.cOperation, tblFocost.cInstrutyp, tblFocost.nBaseunit, tblFocost.cUnitofmeasurement, tblFocost.cUnitofTrading, tblFocost.nTradeablelot, tblFocost.nPricenumerator, tblFocost.nPricedenominator, tblFocost.nGeneralnumerator, tblFocost.nGeneraldenominator, tblFocost.dExpirydate, tblFocost.nStrikeprice, tblFocost.cOptiontype, tblFocost.nSummarybuy, tblFocost.nSumBuyamount, tblFocost.nSummarysell, tblFocost.nSumSellamount), tblPortderfinal as (Select tblFinalcost.cClientcode as cClientcode, tblFinalcost.cScripcode as cScripcode, tblFinalcost.cScripname as cScripname, tblFinalcost.cOperation as cOperation, tblFinalcost.cInstrutyp as cInstrutyp, tblFinalcost.nBaseunit as nBaseunit, tblFinalcost.cUnitofmeasurement as cUnitofmeasurement, tblFinalcost.cUnitofTrading as cUnitofTrading, tblFinalcost.nTradeablelot as nTradeablelot, tblFinalcost.nPricenumerator as nPricenumerator, tblFinalcost.nPricedenominator as nPricedenominator, tblFinalcost.nGeneralnumerator as nGeneralnumerator, tblFinalcost.nGeneraldenominator as nGeneraldenominator, tblFinalcost.nStrikeprice as nStrikeprice, tblFinalcost.cOptiontype as cOptiontype, tblFinalcost.dExpirydate as dExpirydate, tblFinalcost.nPurchqty As nPurchqty, tblFinalcost.nPurchvalue As nPurchvalue, Round(Case When tblFinalcost.nPurchqty != 0 then tblFinalcost.nPurchvalue / tblFinalcost.nPurchqty else 0 End, 4) As nPurchavg, tblFinalcost.nSalesqty as nSalesqty, tblFinalcost.nSalesvalue as nSalesvalue, Round(Case When tblFinalcost.nSalesqty != 0 then tblFinalcost.nSalesvalue / tblFinalcost.nSalesqty else 0 end, 4) as nSalesavg, tblFinalcost.nOsstock As nOsstock, tblFinalcost.nOsstockavg as nOsstockavg, tblFinalcost.nOsstockvalue as nOsstockvalue, tblFinalcost.nMarketrate as nMarketrate, tblFinalcost.nMarketvalue as nMarketvalue, ((tblFinalcost.nMarketrate * tblFinalcost.nOsstock) - (tblFinalcost.nOsstock * tblFinalcost.nOsstockavg)) as nUnrealprlo, tblFinalcost.nProfitloss as nProfitLoss, tblFinalcost.nOverallprlo as nOverallprlo, tblFinalcost.nPrvcloseprice as nPrvcloseprice, tblFinalcost.nHighprice as nHighprice, tblFinalcost.nLowprice as nLowprice, tblFinalcost.nLowercircuitLimit as nLowercircuitlimit, tblFinalcost.nOpenprice as nOpenprice, tblFinalcost.nUppercircuitlimit as nUppercircuitlimit, tblFinalcost.nNooftrades as nNooftrades, tblFinalcost.nVoltradedtoday as nVoltradedtoday, tblFinalcost.nVolquantity as nVolquantity, tblFinalcost.dLastupdatedate as dlastupdatedate, tblFinalcost.n52WeekLow as n52Weeklow, tblFinalcost.n52Weekhigh as n52Weekhigh From tblFinalcost tblFinalcost Order by tblFinalcost.cClientcode, tblFinalcost.cScripname, tblFinalcost.nStrikeprice, tblFinalcost.cOptiontype, tblFinalcost.dExpirydate ), tblPortderfin as (Select tblPortderfinal.cClientcode as cClientcode, '05' as cRowindicator, Sum(tblPortderfinal.nProfitloss) as nFiramount, 0 as nSecamount From tblPortderfinal tblPortderfinal group by tblPortderfinal.cClientcode Union All Select tblPortderfinal.cClientcode as cClientcode, '09' as cRowindicator, Sum(tblPortderfinal.nUnrealprlo) as nFiramount, 0 as nSecamount From tblPortderfinal tblPortderfinal group by tblPortderfinal.cClientcode), tblCashplusderfinal as (Select Coalesce(tblPortcashfin.cClientcode,tblPortderfin.cClientcode) as cClientcode, Case When Coalesce(tblPortcashfin.cRowindicator,tblPortderfin.cRowindicator)='04' or Coalesce(tblPortcashfin.cRowindicator,tblPortderfin.cRowindicator)='05' then '06' else '10' end as cRowindicator, 0 as nFiramount, Sum(Coalesce(tblPortcashfin.nFiramount,tblPortderfin.nFiramount,0)) as nSecamount From tblPortcashfin Full outer join tblPortderfin On tblPortcashfin.cClientcode=tblPortderfin.cClientcode and tblPortcashfin.cRowindicator=tblPortderfin.cRowindicator Where tblPortcashfin.cRowindicator='04' or tblPortcashfin.cRowindicator='08' or tblPortderfin.cRowindicator='05' or tblPortderfin.cRowindicator='09' group by Coalesce(tblPortcashfin.cClientcode,tblPortderfin.cClientcode) , Case When Coalesce(tblPortcashfin.cRowindicator,tblPortderfin.cRowindicator)='04' or Coalesce(tblPortcashfin.cRowindicator,tblPortderfin.cRowindicator)='05' then '06' else '10' end ), tblDividend as (Select Ledger.Oowncode as cClientcode, '11' as cRowindicator, 0 as nFiramount, Sum(Ledger.damount-Ledger.Camount)*-1 as nSecamount From Ledger Ledger Inner Join Journal On Ledger.Firmnumber=Journal.Firmnumber and Ledger.Voucher=Journal.Jvnumber and Ledger.nFinancialyear=Journal.nFinancialyear Where Ledger.Firmnumber='NBS-000001' and Ledger.nFinancialyear=2024 and (Ledger.Oowncode='R2030002') and Ledger.Branchcode='495' and Ledger.Dtoftran>=to_date('01/04/2023','dd/mm/yyyy') and Ledger.Dtoftran<=to_date('31/03/2024','dd/mm/yyyy') and Journal.nEntrytype=1 group by Ledger.Oowncode ), tblDirectDividend as (Select tblDirectdiv.cClientcode as cClientcode, '16' as cRowindicator, 0 as nFiramount, Sum(tblDirectdiv.nQuantity*tblDirectdiv.nRate)*-1 as nSecamount From tblDirectdiv tblDirectdiv Inner Join Ldfibs Ldfibs On tblDirectdiv.cFirmnumber = Ldfibs.Firmnumber and tblDirectdiv.cClientcode = Ldfibs.Oowncode Where tblDirectdiv.cFirmnumber='NBS-000001' and (tblDirectdiv.cClientcode='R2030002') and tblDirectdiv.dDtoftran>=to_date('01/04/2023','dd/mm/yyyy') and tblDirectdiv.dDtoftran<=to_date('31/03/2024','dd/mm/yyyy') group by tblDirectdiv.cClientcode ), tbltmpBillcharges as (Select Billcharges.Oowncode as cClientcode, Case When Billcharges.Egroup='FU' then '14' else '13' end as cRowindicator, Sum(Billcharges.Quantity*Billcharges.Final_Rat1) as nFiramount, 0 as nSecamount From Billcharges Billcharges Where Billcharges.Firmnumber='NBS-000001' and Billcharges.Brcode='495' and (Billcharges.Oowncode='R2030002') and Billcharges.Dtoftran>=to_date('01/04/2023','dd/mm/yyyy') and Billcharges.Dtoftran<=to_date('31/03/2024','dd/mm/yyyy') group by Billcharges.Oowncode, Case When Billcharges.Egroup='FU' then '14' else '13' end ), tbltmpbillchgtotal as (Select tbltmpBillcharges.cClientcode as cClientcode, '12' as cRowindicator, 0 as nFiramount, Sum(tbltmpBillcharges.nFiramount) as nSecamount from tbltmpBillcharges tbltmpBillcharges group by tbltmpbillcharges.cClientcode ), tblMiscentries as ( Select Ledger.Oowncode as cClientcode, '15' as cRowindicator, 0 as nFiramount, Sum(Ledger.damount-Ledger.Camount)*-1 as nSecamount From Ledger Ledger Inner Join Journal On Ledger.Firmnumber=Journal.Firmnumber and Ledger.Voucher=Journal.Jvnumber and Ledger.nFinancialyear=Journal.nFinancialyear Where Ledger.Firmnumber='NBS-000001' and Ledger.nFinancialyear=2024 and (Ledger.Oowncode='R2030002') and Ledger.Branchcode='495' and Ledger.Dtoftran>=to_date('01/04/2023','dd/mm/yyyy') and Ledger.Dtoftran<=to_date('31/03/2024','dd/mm/yyyy') and Journal.nEntrytype!=1 group by Ledger.Oowncode ), tbltempportalloc as (Select Coalesce(tblFinledger.cClientcode,tblPortcashfin.cClientcode) as cClientcode, '27' as cRowindicator, Sum(Nvl(tblFinledger.nFiramount,0)+Nvl(tblPortcashfin.nFiramount,0)) as nFiramount, 0 as nSecamount From tblFinledger tblFinledger Full Outer Join tblPortcashfin On tblFinledger.cClientcode=tblPortcashfin.cClientcode and tblFinledger.cRowindicator=tblPortcashfin.cRowindicator Where (tblFinledger.cRowindicator='26' or tblPortcashfin.cRowindicator='25') group by Coalesce(tblFinledger.cClientcode,tblPortcashfin.cClientcode) ), tbltemptotdays as (Select '18' as cRowindicator, (to_date('31/03/2024','dd/mm/yyyy') - to_date('01/04/2024','dd/mm/yyyy'))+1 as nSecamount From dual ), tblFinalloop as (Select tblReportdesc.cRowindicator as cRowindicator, tblReportdesc.cRowdesc as cRowdesc, Coalesce(tblReportdesc.cClientcode,tblOpenstk.cClientcode,tblCapinout.cClientcode,tblPortcashfin.cClientcode,tblPortderfin.cClientcode,tblCashplusderfinal.cClientcode,tblDividend.cClientcode,tbltmpbillcharges.cClientcode,tbltmpbillchgtotal.cClientcode,tblMiscentries.cClientcode,tblFinledger.cClientcode,tbltempPortalloc.cClientcode,tblDirectdividend.cClientcode) as cClientcode, Coalesce(tblOpenstk.nFiramount,tblCapinout.nFiramount,tblPortcashfin.nFiramount,tblPortderfin.nFiramount,tblCashplusderfinal.nFiramount,tblDividend.nFiramount,tbltmpBillcharges.nFiramount,tbltmpbillchgtotal.nFiramount,tblMiscentries.nFiramount,tblFinledger.nFiramount,tbltempPortalloc.nFiramount,tblDirectdividend.nFiramount) as nFiramount, Coalesce(tblOpenstk.nSecamount,tblCapinout.nSecamount,tblPortcashfin.nSecamount,tblPortderfin.nSecamount,tblCashplusderfinal.nSecamount,tblDividend.nSecamount,tbltmpBillcharges.nSecamount,tbltmpBillchgtotal.nSecamount,tblMiscentries.nSecamount,tblFinledger.nSecamount,tbltempPortalloc.nSecamount,tbltempTotdays.nSecamount,tbltempTotdays.nSecamount) as nSecamount From tblReportdesc tblReportdesc Left Outer Join tblOpenstk On tblReportdesc.cRowindicator=tblOpenstk.cRowindicator and tblReportdesc.cClientcode=tblOpenstk.cClientcode Left Outer Join tblCapinout On tblReportdesc.cRowindicator=tblCapinout.cRowindicator and tblReportdesc.cClientcode=tblCapinout.cClientcode Left Outer Join tblPortcashfin On tblReportdesc.cRowindicator=tblPortcashfin.cRowindicator and tblReportdesc.cClientcode=tblPortcashfin.cClientcode Left Outer Join tblPortderfin On tblReportdesc.cRowindicator=tblPortderfin.cRowindicator and tblReportdesc.cClientcode=tblPortderfin.cClientcode Left Outer Join tblCashplusderfinal On tblReportdesc.cRowindicator=tblCashplusderfinal.cRowindicator and tblReportdesc.cClientcode=tblCashplusderfinal.cClientcode Left Outer Join tblDividend On tblReportdesc.cRowindicator=tblDividend.cRowindicator and tblReportdesc.cClientcode=tblDividend.cClientcode Left Outer Join tbltmpBillcharges On tblReportdesc.cRowindicator=tbltmpBillcharges.cRowindicator and tblReportdesc.cClientcode=tbltmpBillcharges.cClientcode Left Outer Join tbltmpbillchgtotal On tblReportdesc.cRowindicator=tbltmpBillchgtotal.cRowindicator and tblReportdesc.cClientcode=tbltmpBillchgtotal.cClientcode Left Outer Join tblMiscentries On tblReportdesc.cRowindicator=tblMiscentries.cRowindicator and tblReportdesc.cClientcode=tblMiscentries.cClientcode Left Outer Join tblFinledger On tblReportdesc.cRowindicator=tblFinledger.cRowindicator and tblReportdesc.cClientcode=tblFinledger.cClientcode Left Outer Join tbltempPortalloc On tblReportdesc.cRowindicator=tbltempPortalloc.cRowindicator and tblReportdesc.cClientcode=tbltempPortalloc.cClientcode Left Outer Join tblDirectdividend On tblReportdesc.cRowindicator=tblDirectdividend.cRowindicator and tblReportdesc.cClientcode=tblDirectdividend.cClientcode Left Outer Join tbltemptotdays On tblReportdesc.cRowindicator=tbltempTotdays.cRowindicator ), tbltempporttotal as ( Select '17' as cRowindicator, tblFinalloop.cClientcode as cClientcode, Sum(tblFinalloop.nSecamount) as nTotalamount From tblFinalloop Where tblFinalloop.cRowindicator!='18' and nvl(trim(tblFinalloop.cClientcode),' ')!=' ' group by tblFinalloop.cClientcode ), tbltemptotalcapital as ( Select tblFinalloop.cClientcode as cClientcode, Sum(tblFinalloop.nSecamount) as nTotalamount From tblFinalloop tblFinalloop Where (tblFinalloop.cRowindicator='02' or tblFinalloop.cRowindicator='01') and nvl(trim(tblFinalloop.cClientcode),' ')!=' ' group by tblFinalloop.cClientcode ) Select tblFinalloop.cRowindicator as cRowindicator, tblFinalloop.cRowdesc as cRowdesc, tblFinalloop.cClientcode as cClientcode, tblFinalloop.nFiramount as nFiramount, Case When (tblFinalloop.cRowindicator=25 or tblFinalloop.cRowindicator=26) and tbltempPortalloc.nFiramount!=0 then Round(tblFinalloop.nFiramount/tbltempPortalloc.nFiramount*100,2) When tblFInalloop.cRowindicator='17' then tbltempporttotal.nTotalamount When tblFinalloop.cRowindicator='19' and tbltemptotalcapital.nTotalamount!=0 then Round((tbltempporttotal.nTotalamount-tbltemptotalcapital.nTotalamount)*100/tbltemptotalcapital.nTotalamount,2) When tblFinalloop.cRowindicator='20' and tbltemptotalcapital.nTotalamount!=0 then Round(((tbltempporttotal.nTotalamount-tbltemptotalcapital.nTotalamount)*100/tbltemptotalcapital.nTotalamount)*365/ ((to_date('31/03/2024','dd/mm/yyyy') - to_date('01/04/2024','dd/mm/yyyy')+1)),2) else tblFinalloop.nSecamount end as nSecamount From tblFinalloop Left Outer Join tbltempportalloc On tblFinalloop.cClientcode=tbltempportalloc.cClientcode Left Outer Join tbltempporttotal On tblFinalloop.cClientcode=tbltempporttotal.cClientcode Left Outer Join tbltemptotalcapital On tblFinalloop.cClientcode=tbltemptotalcapital.cClientcode Order by 1 Title : 01~Error Description : ORA-01476: divisor is equal to zero Method : getglobalportfolioLine : 44015 Message : getGlobalportfolio StackTrace : at OracleInternal.ServiceObjects.OracleConnectionImpl.VerifyExecution(Int32& cursorId, Boolean bThrowArrayBindRelatedErrors, SqlStatementType sqlStatementType, Int32 arrayBindCount, OracleException& exceptionForArrayBindDML, Boolean& hasMoreRowsInDB, Boolean bFirstIterationDone) at OracleInternal.ServiceObjects.OracleCommandImpl.ExecuteReader(String commandText, OracleParameterCollection paramColl, CommandType commandType, OracleConnectionImpl connectionImpl, OracleDataReaderImpl& rdrImpl, Int32 longFetchSize, Int64 clientInitialLOBFS, OracleDependencyImpl orclDependencyImpl, Int64[] scnForExecution, Int64[]& scnFromExecution, OracleParameterCollection& bindByPositionParamColl, Boolean& bBindParamPresent, Int64& internalInitialLOBFS, OracleException& exceptionForArrayBindDML, OracleConnection connection, OracleLogicalTransaction& oracleLogicalTransaction, IEnumerable`1 adrianParsedStmt, Boolean isDescribeOnly, Boolean isFromEF) at Oracle.ManagedDataAccess.Client.OracleCommand.ExecuteReader(Boolean requery, Boolean fillRequest, CommandBehavior behavior) at Oracle.ManagedDataAccess.Client.OracleDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable) at clientlevel.Thinclientlevel.Clientlogin.getglobalportfolio(DateTime tdStartdate, DateTime tdEnddate, DateTime tdPoadate, DateTime tdFinancialstartdate, Int32 tnAngleselection, String tcClientfilter, Cliole loLdcommon) in File25:line 44015 Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 394616832 Shut down : N Username : MOBBO Date/Time : 17/05/2024 11:33:22 PM Connection : Closed =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKS3120020Image180524093035.png$N$~ Message : UpdateEkycdata StackTrace : tpDocimageforBank Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 920862720 Shut down : N Username : MOBBO Date/Time : 18/05/2024 9:30:57 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKS3120020Image180524093035.png$N$ Message : UpdateEkycdata StackTrace : lcDocsrtring[i] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 920879104 Shut down : N Username : MOBBO Date/Time : 18/05/2024 9:30:57 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKS3120020Image180524093035.png Message : UpdateEkycdata StackTrace : lcProoffile[0] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 920879104 Shut down : N Username : MOBBO Date/Time : 18/05/2024 9:30:57 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKL2940033Image180524094134.png$N$~ Message : UpdateEkycdata StackTrace : tpDocimageforBank Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 1007497216 Shut down : N Username : MOBBO Date/Time : 18/05/2024 9:41:48 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKL2940033Image180524094134.png$N$ Message : UpdateEkycdata StackTrace : lcDocsrtring[i] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 1007513600 Shut down : N Username : MOBBO Date/Time : 18/05/2024 9:41:48 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKL2940033Image180524094134.png Message : UpdateEkycdata StackTrace : lcProoffile[0] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 1007513600 Shut down : N Username : MOBBO Date/Time : 18/05/2024 9:41:48 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Select tblFirmcreation.cshortname as cShortname From tblFirmcreation tblFirmcreation Where tblFirmcreation.cUserFirmcode='NBS-000001' Title : 01~Error Description : Value cannot be null. Parameter name: dataTable Method : AgeingacrossyearLine : 46316 Message : Ageingacrossyear StackTrace : at System.Data.Common.DataAdapter.Fill(DataTable[] dataTables, IDataReader dataReader, Int32 startRecord, Int32 maxRecords) at Oracle.ManagedDataAccess.Client.OracleDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable) at clientlevel.Thinclientlevel.Clientlogin.Ageingacrossyear(DateTime tdTransactiondate, Int32 tnTotaldays1, Int32 tnTotaldays2, Int32 tnTotaldays3, Int32 tnAngleselection, Int32 tnTotaldays4, Int32 tnTotaldays5, Int32 tnTotaldays6, Cliole loLdcommon, Int32 tnTotaldays7, Int32 tnTotaldays8, Int32 tnTotaldays9, Int32 tnTotaldays10, Int32 tnTotaldays11, Int32 tnTotaldays12, Int32 tnIncludepreviousyear, Int32 tnIgnorebounced, Int32 tnonlyReconciledentries, Int32 tnTerminalcodejoin, String& tcCashpayindate, String& tcFopayindate, Int32 tnAgeingonTransactiondate, String tcClientcode, Double tnAmount, String& tcSebiageingdate) in File25:line 46316 Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 989544448 Shut down : N Username : MOBBO Date/Time : 18/05/2024 10:06:13 AM Connection : Closed =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Select tblFirmcreation.cshortname as cShortname From tblFirmcreation tblFirmcreation Where tblFirmcreation.cUserFirmcode='NBS-000001' Title : 01~Error Description : Value cannot be null. Parameter name: dataTable Method : AgeingacrossyearLine : 46316 Message : Ageingacrossyear StackTrace : at System.Data.Common.DataAdapter.Fill(DataTable[] dataTables, IDataReader dataReader, Int32 startRecord, Int32 maxRecords) at Oracle.ManagedDataAccess.Client.OracleDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable) at clientlevel.Thinclientlevel.Clientlogin.Ageingacrossyear(DateTime tdTransactiondate, Int32 tnTotaldays1, Int32 tnTotaldays2, Int32 tnTotaldays3, Int32 tnAngleselection, Int32 tnTotaldays4, Int32 tnTotaldays5, Int32 tnTotaldays6, Cliole loLdcommon, Int32 tnTotaldays7, Int32 tnTotaldays8, Int32 tnTotaldays9, Int32 tnTotaldays10, Int32 tnTotaldays11, Int32 tnTotaldays12, Int32 tnIncludepreviousyear, Int32 tnIgnorebounced, Int32 tnonlyReconciledentries, Int32 tnTerminalcodejoin, String& tcCashpayindate, String& tcFopayindate, Int32 tnAgeingonTransactiondate, String tcClientcode, Double tnAmount, String& tcSebiageingdate) in File25:line 46316 Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 989532160 Shut down : N Username : MOBBO Date/Time : 18/05/2024 10:06:19 AM Connection : Closed =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKB003052Image180524101607.png$N$~ Message : UpdateEkycdata StackTrace : tpDocimageforBank Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 560095232 Shut down : N Username : MOBBO Date/Time : 18/05/2024 10:16:30 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKB003052Image180524101607.png$N$ Message : UpdateEkycdata StackTrace : lcDocsrtring[i] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 560111616 Shut down : N Username : MOBBO Date/Time : 18/05/2024 10:16:30 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKB003052Image180524101607.png Message : UpdateEkycdata StackTrace : lcProoffile[0] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 560111616 Shut down : N Username : MOBBO Date/Time : 18/05/2024 10:16:30 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKD1203523Image180524103401.png$N$~ Message : UpdateEkycdata StackTrace : tpDocimageforBank Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 473415680 Shut down : N Username : MOBBO Date/Time : 18/05/2024 10:34:55 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKD1203523Image180524103401.png$N$ Message : UpdateEkycdata StackTrace : lcDocsrtring[i] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 473432064 Shut down : N Username : MOBBO Date/Time : 18/05/2024 10:34:55 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKD1203523Image180524103401.png Message : UpdateEkycdata StackTrace : lcProoffile[0] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 473432064 Shut down : N Username : MOBBO Date/Time : 18/05/2024 10:34:55 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Merge into tblCCMekycbankchqrmkr@lnk_ccm T1 using ( Select 'NBS-000001' as cFirmnumber, 'D1203523' as cClientcode,34156 as nEkycrefno from dual ) T2 on (T1.cFirmnumber=T2.cFirmnumber and T1.cClientcode=T2.cClientcode and T1.nEkycdoucmentno=T2.nEkycrefno) when matched then update set cBankcode='391',cBankname='THE KARUR VYSYA BANK LTD',cIfsccode='KVBL0004104',cMicrcode='110053006',cBranchname='NEW DEL',cBankacno='4104155000001267', cChqprintname='SJNITA MANGLIK', cbankactype='Savings', cDefaultbank='Y', dApiverificationstart=to_date('18/05/2024 10:34:40','dd/MM/yyyy hh24:mi:ss'),dApiresponcerecd=sysdate,cApiresponceid='SVR577F4QWKBLX4', cNameasperresponce='SUNITA MANGLIK',cMaker='7P0xjcr56xLZ0TS1bcaGKQ==' when not matched then Insert (cFirmnumber,cClientcode,nEkycdoucmentno,cBankcode,cBankname,cIfsccode,cMicrcode,cBranchname,cBankacno,cChqprintname, cbankactype,cDefaultbank, dApiverificationstart,dApiresponcerecd,cApiresponceid,cNameasperresponce,cMaker,cChecker) Values ('NBS-000001', 'D1203523',34156,'391','THE KARUR VYSYA BANK LTD','KVBL0004104','110053006','NEW DEL','4104155000001267','SJNITA MANGLIK', 'Savings', 'Y', to_date('18/05/2024 10:34:40','dd/MM/yyyy hh24:mi:ss'),sysdate,'SVR577F4QWKBLX4','SUNITA MANGLIK','7P0xjcr56xLZ0TS1bcaGKQ==',' ') Title : 01~Error Description : Could not find file 'D:\Inetpub\wwwroot\LdMobileService\EkycDocimages\BANKD1203523Image180524103401.png'. Method : UpdateEkycdataLine : 71449 Message : UpdateEkycdata StackTrace : at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) at System.IO.File.InternalReadAllBytes(String path, Boolean checkHost) at ekyc.ekycdata.UpdateEkycdata(Cliole loLdcommon, Int32 tnAngleselection, String tcClientcode, String tcRequstType, String tcMobile, String tcEmailaddress, String tcClientname, String tcFirstname, String tcSecondname, String tcLastname, String tcCorraddressline1, String tcCorraddressline2, String tcCorraddressline3, String tcCorraddresscity, String tnCorrpin, String tcCorrstate, String tcCorrstateother, String tcCorrcountry, String tcCorraddressproof, String tcCorraddressrefid, String tdCorraddressproofissuedt, String tdCorraddressproofexpirydt, String tcPfraddressline1, String tcPfraddressline2, String tcPfraddressline3, String tcPfraddresscity, Int32 tnPfrpin, String tcPfrstate, String tcPfrstateother, String tcPfrcountry, String tcPfraddressproof, String tcPfraddressproofrefid, String tdPfraddressproofissuedt, String tdPfraddressproofexpirydt, String tcResdstatuscode, String tcGender, String tcMaritalstatus, String tcFatherSpousename, String tcNationality, String tcPrefixmaidenname, String tcApplicantMaidenname, String tcPrefixfatherspouse, String tcPrefixmothername, String tcMothername, String tcMothermaidenname, String tcFatcaProofofaddress, String tcFatcaIdnumber, String tcFatcataxresidence, String tcCountryofbirth, String tcCityofbirth, Int64 tnAnnualincome, Int64 tnNetworth, String tdNetworth, String tcDeviceinfo, Int32 tnUpdateKYC, Int32 tnUpdateaddress, Int32 tnUpadateFatca, Int32 tnUpdateMobile, Int32 tnUpdateemail, Int32 tnUpdateBank, Int32 tnUpdateDemat, String tcUserid, String tcFatherHusbandflag, String tpDocimageforAddress, String tpDocimageforKYC, String tpDocimageforFatca, String tcBankdetails, String tpDocimageforBank, String tcDematdetails, String tpDocimageforDemat, String tcOccupation, String tcEsigneddoneby, Int64& tnEkycDocumentno, String tcFilepath, String tcAddressasperKyc, Int64 tnEkycreferenceno, String tcUseraction, String tcIdentifier, String tcEsignPdffilename, String& tceSigndocumentid, Cliole loCCMcon, String tcEsignmethod, String tcEmailFamily, String tcEconfirmation, String tcMobilefamily, Int32 tnUpdateOtherdetails, String tdDOB, String tcAadharnumber, String tceducation, String tcInternettradingflag, String tcDPfees, String tcIBTdetails, String tcIPVproofdetails, String tcDepository, Int32 tnInternetsoftware, String tcKRAAddressIPV, Boolean tlEsignwithClientname, Int32 tnUpdatenominee, String tcNomineedetails, String tcNomineeproof, String tcClientSignaturefile, String tcNomineeopted, String tcNomineeoptout, Int32 tnUpdateSegment, String tcSegmentActivationdetails, String tcSegmentDeActivationdetails, String tcSegmentproofdetails, String tcSchemecode, String tcEsigncoordinator, String tcsubcategoryforcomm, String tcCommodiyitemlist, String tcDerConsentgiven) in File25:line 71449 Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 474513408 Shut down : N Username : MOBBO Date/Time : 18/05/2024 10:34:55 AM Connection : Closed =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKD1203523Image180524103401.png$N$~ Message : UpdateEkycdata StackTrace : tpDocimageforBank Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 642060288 Shut down : N Username : MOBBO Date/Time : 18/05/2024 10:35:16 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKD1203523Image180524103401.png$N$ Message : UpdateEkycdata StackTrace : lcDocsrtring[i] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 642060288 Shut down : N Username : MOBBO Date/Time : 18/05/2024 10:35:16 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKD1203523Image180524103401.png Message : UpdateEkycdata StackTrace : lcProoffile[0] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 642060288 Shut down : N Username : MOBBO Date/Time : 18/05/2024 10:35:16 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Merge into tblCCMekycbankchqrmkr@lnk_ccm T1 using ( Select 'NBS-000001' as cFirmnumber, 'D1203523' as cClientcode,34157 as nEkycrefno from dual ) T2 on (T1.cFirmnumber=T2.cFirmnumber and T1.cClientcode=T2.cClientcode and T1.nEkycdoucmentno=T2.nEkycrefno) when matched then update set cBankcode='391',cBankname='THE KARUR VYSYA BANK LTD',cIfsccode='KVBL0004104',cMicrcode='110053006',cBranchname='NEW DEL',cBankacno='4104155000001267', cChqprintname='SJNITA MANGLIK', cbankactype='Savings', cDefaultbank='Y', dApiverificationstart=to_date('18/05/2024 10:34:40','dd/MM/yyyy hh24:mi:ss'),dApiresponcerecd=sysdate,cApiresponceid='SVR577F4QWKBLX4', cNameasperresponce='SUNITA MANGLIK',cMaker='7P0xjcr56xLZ0TS1bcaGKQ==' when not matched then Insert (cFirmnumber,cClientcode,nEkycdoucmentno,cBankcode,cBankname,cIfsccode,cMicrcode,cBranchname,cBankacno,cChqprintname, cbankactype,cDefaultbank, dApiverificationstart,dApiresponcerecd,cApiresponceid,cNameasperresponce,cMaker,cChecker) Values ('NBS-000001', 'D1203523',34157,'391','THE KARUR VYSYA BANK LTD','KVBL0004104','110053006','NEW DEL','4104155000001267','SJNITA MANGLIK', 'Savings', 'Y', to_date('18/05/2024 10:34:40','dd/MM/yyyy hh24:mi:ss'),sysdate,'SVR577F4QWKBLX4','SUNITA MANGLIK','7P0xjcr56xLZ0TS1bcaGKQ==',' ') Title : 01~Error Description : Could not find file 'D:\Inetpub\wwwroot\LdMobileService\EkycDocimages\BANKD1203523Image180524103401.png'. Method : UpdateEkycdataLine : 71449 Message : UpdateEkycdata StackTrace : at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) at System.IO.File.InternalReadAllBytes(String path, Boolean checkHost) at ekyc.ekycdata.UpdateEkycdata(Cliole loLdcommon, Int32 tnAngleselection, String tcClientcode, String tcRequstType, String tcMobile, String tcEmailaddress, String tcClientname, String tcFirstname, String tcSecondname, String tcLastname, String tcCorraddressline1, String tcCorraddressline2, String tcCorraddressline3, String tcCorraddresscity, String tnCorrpin, String tcCorrstate, String tcCorrstateother, String tcCorrcountry, String tcCorraddressproof, String tcCorraddressrefid, String tdCorraddressproofissuedt, String tdCorraddressproofexpirydt, String tcPfraddressline1, String tcPfraddressline2, String tcPfraddressline3, String tcPfraddresscity, Int32 tnPfrpin, String tcPfrstate, String tcPfrstateother, String tcPfrcountry, String tcPfraddressproof, String tcPfraddressproofrefid, String tdPfraddressproofissuedt, String tdPfraddressproofexpirydt, String tcResdstatuscode, String tcGender, String tcMaritalstatus, String tcFatherSpousename, String tcNationality, String tcPrefixmaidenname, String tcApplicantMaidenname, String tcPrefixfatherspouse, String tcPrefixmothername, String tcMothername, String tcMothermaidenname, String tcFatcaProofofaddress, String tcFatcaIdnumber, String tcFatcataxresidence, String tcCountryofbirth, String tcCityofbirth, Int64 tnAnnualincome, Int64 tnNetworth, String tdNetworth, String tcDeviceinfo, Int32 tnUpdateKYC, Int32 tnUpdateaddress, Int32 tnUpadateFatca, Int32 tnUpdateMobile, Int32 tnUpdateemail, Int32 tnUpdateBank, Int32 tnUpdateDemat, String tcUserid, String tcFatherHusbandflag, String tpDocimageforAddress, String tpDocimageforKYC, String tpDocimageforFatca, String tcBankdetails, String tpDocimageforBank, String tcDematdetails, String tpDocimageforDemat, String tcOccupation, String tcEsigneddoneby, Int64& tnEkycDocumentno, String tcFilepath, String tcAddressasperKyc, Int64 tnEkycreferenceno, String tcUseraction, String tcIdentifier, String tcEsignPdffilename, String& tceSigndocumentid, Cliole loCCMcon, String tcEsignmethod, String tcEmailFamily, String tcEconfirmation, String tcMobilefamily, Int32 tnUpdateOtherdetails, String tdDOB, String tcAadharnumber, String tceducation, String tcInternettradingflag, String tcDPfees, String tcIBTdetails, String tcIPVproofdetails, String tcDepository, Int32 tnInternetsoftware, String tcKRAAddressIPV, Boolean tlEsignwithClientname, Int32 tnUpdatenominee, String tcNomineedetails, String tcNomineeproof, String tcClientSignaturefile, String tcNomineeopted, String tcNomineeoptout, Int32 tnUpdateSegment, String tcSegmentActivationdetails, String tcSegmentDeActivationdetails, String tcSegmentproofdetails, String tcSchemecode, String tcEsigncoordinator, String tcsubcategoryforcomm, String tcCommodiyitemlist, String tcDerConsentgiven) in File25:line 71449 Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 642072576 Shut down : N Username : MOBBO Date/Time : 18/05/2024 10:35:16 AM Connection : Closed =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKD1203523Image180524103401.png$N$~ Message : UpdateEkycdata StackTrace : tpDocimageforBank Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 734621696 Shut down : N Username : MOBBO Date/Time : 18/05/2024 10:35:31 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKD1203523Image180524103401.png$N$ Message : UpdateEkycdata StackTrace : lcDocsrtring[i] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 734621696 Shut down : N Username : MOBBO Date/Time : 18/05/2024 10:35:31 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKD1203523Image180524103401.png Message : UpdateEkycdata StackTrace : lcProoffile[0] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 734629888 Shut down : N Username : MOBBO Date/Time : 18/05/2024 10:35:31 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Merge into tblCCMekycbankchqrmkr@lnk_ccm T1 using ( Select 'NBS-000001' as cFirmnumber, 'D1203523' as cClientcode,34158 as nEkycrefno from dual ) T2 on (T1.cFirmnumber=T2.cFirmnumber and T1.cClientcode=T2.cClientcode and T1.nEkycdoucmentno=T2.nEkycrefno) when matched then update set cBankcode='391',cBankname='THE KARUR VYSYA BANK LTD',cIfsccode='KVBL0004104',cMicrcode='110053006',cBranchname='NEW DEL',cBankacno='4104155000001267', cChqprintname='SJNITA MANGLIK', cbankactype='Savings', cDefaultbank='Y', dApiverificationstart=to_date('18/05/2024 10:34:40','dd/MM/yyyy hh24:mi:ss'),dApiresponcerecd=sysdate,cApiresponceid='SVR577F4QWKBLX4', cNameasperresponce='SUNITA MANGLIK',cMaker='7P0xjcr56xLZ0TS1bcaGKQ==' when not matched then Insert (cFirmnumber,cClientcode,nEkycdoucmentno,cBankcode,cBankname,cIfsccode,cMicrcode,cBranchname,cBankacno,cChqprintname, cbankactype,cDefaultbank, dApiverificationstart,dApiresponcerecd,cApiresponceid,cNameasperresponce,cMaker,cChecker) Values ('NBS-000001', 'D1203523',34158,'391','THE KARUR VYSYA BANK LTD','KVBL0004104','110053006','NEW DEL','4104155000001267','SJNITA MANGLIK', 'Savings', 'Y', to_date('18/05/2024 10:34:40','dd/MM/yyyy hh24:mi:ss'),sysdate,'SVR577F4QWKBLX4','SUNITA MANGLIK','7P0xjcr56xLZ0TS1bcaGKQ==',' ') Title : 01~Error Description : Could not find file 'D:\Inetpub\wwwroot\LdMobileService\EkycDocimages\BANKD1203523Image180524103401.png'. Method : UpdateEkycdataLine : 71449 Message : UpdateEkycdata StackTrace : at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) at System.IO.File.InternalReadAllBytes(String path, Boolean checkHost) at ekyc.ekycdata.UpdateEkycdata(Cliole loLdcommon, Int32 tnAngleselection, String tcClientcode, String tcRequstType, String tcMobile, String tcEmailaddress, String tcClientname, String tcFirstname, String tcSecondname, String tcLastname, String tcCorraddressline1, String tcCorraddressline2, String tcCorraddressline3, String tcCorraddresscity, String tnCorrpin, String tcCorrstate, String tcCorrstateother, String tcCorrcountry, String tcCorraddressproof, String tcCorraddressrefid, String tdCorraddressproofissuedt, String tdCorraddressproofexpirydt, String tcPfraddressline1, String tcPfraddressline2, String tcPfraddressline3, String tcPfraddresscity, Int32 tnPfrpin, String tcPfrstate, String tcPfrstateother, String tcPfrcountry, String tcPfraddressproof, String tcPfraddressproofrefid, String tdPfraddressproofissuedt, String tdPfraddressproofexpirydt, String tcResdstatuscode, String tcGender, String tcMaritalstatus, String tcFatherSpousename, String tcNationality, String tcPrefixmaidenname, String tcApplicantMaidenname, String tcPrefixfatherspouse, String tcPrefixmothername, String tcMothername, String tcMothermaidenname, String tcFatcaProofofaddress, String tcFatcaIdnumber, String tcFatcataxresidence, String tcCountryofbirth, String tcCityofbirth, Int64 tnAnnualincome, Int64 tnNetworth, String tdNetworth, String tcDeviceinfo, Int32 tnUpdateKYC, Int32 tnUpdateaddress, Int32 tnUpadateFatca, Int32 tnUpdateMobile, Int32 tnUpdateemail, Int32 tnUpdateBank, Int32 tnUpdateDemat, String tcUserid, String tcFatherHusbandflag, String tpDocimageforAddress, String tpDocimageforKYC, String tpDocimageforFatca, String tcBankdetails, String tpDocimageforBank, String tcDematdetails, String tpDocimageforDemat, String tcOccupation, String tcEsigneddoneby, Int64& tnEkycDocumentno, String tcFilepath, String tcAddressasperKyc, Int64 tnEkycreferenceno, String tcUseraction, String tcIdentifier, String tcEsignPdffilename, String& tceSigndocumentid, Cliole loCCMcon, String tcEsignmethod, String tcEmailFamily, String tcEconfirmation, String tcMobilefamily, Int32 tnUpdateOtherdetails, String tdDOB, String tcAadharnumber, String tceducation, String tcInternettradingflag, String tcDPfees, String tcIBTdetails, String tcIPVproofdetails, String tcDepository, Int32 tnInternetsoftware, String tcKRAAddressIPV, Boolean tlEsignwithClientname, Int32 tnUpdatenominee, String tcNomineedetails, String tcNomineeproof, String tcClientSignaturefile, String tcNomineeopted, String tcNomineeoptout, Int32 tnUpdateSegment, String tcSegmentActivationdetails, String tcSegmentDeActivationdetails, String tcSegmentproofdetails, String tcSchemecode, String tcEsigncoordinator, String tcsubcategoryforcomm, String tcCommodiyitemlist, String tcDerConsentgiven) in File25:line 71449 Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 734724096 Shut down : N Username : MOBBO Date/Time : 18/05/2024 10:35:31 AM Connection : Closed =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKD1203523Image180524103401.png$N$~ Message : UpdateEkycdata StackTrace : tpDocimageforBank Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 783200256 Shut down : N Username : MOBBO Date/Time : 18/05/2024 10:35:52 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKD1203523Image180524103401.png$N$ Message : UpdateEkycdata StackTrace : lcDocsrtring[i] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 783200256 Shut down : N Username : MOBBO Date/Time : 18/05/2024 10:35:52 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKD1203523Image180524103401.png Message : UpdateEkycdata StackTrace : lcProoffile[0] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 783200256 Shut down : N Username : MOBBO Date/Time : 18/05/2024 10:35:52 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Merge into tblCCMekycbankchqrmkr@lnk_ccm T1 using ( Select 'NBS-000001' as cFirmnumber, 'D1203523' as cClientcode,34159 as nEkycrefno from dual ) T2 on (T1.cFirmnumber=T2.cFirmnumber and T1.cClientcode=T2.cClientcode and T1.nEkycdoucmentno=T2.nEkycrefno) when matched then update set cBankcode='391',cBankname='THE KARUR VYSYA BANK LTD',cIfsccode='KVBL0004104',cMicrcode='110053006',cBranchname='NEW DEL',cBankacno='4104155000001267', cChqprintname='SJNITA MANGLIK', cbankactype='Savings', cDefaultbank='Y', dApiverificationstart=to_date('18/05/2024 10:34:40','dd/MM/yyyy hh24:mi:ss'),dApiresponcerecd=sysdate,cApiresponceid='SVR577F4QWKBLX4', cNameasperresponce='SUNITA MANGLIK',cMaker='7P0xjcr56xLZ0TS1bcaGKQ==' when not matched then Insert (cFirmnumber,cClientcode,nEkycdoucmentno,cBankcode,cBankname,cIfsccode,cMicrcode,cBranchname,cBankacno,cChqprintname, cbankactype,cDefaultbank, dApiverificationstart,dApiresponcerecd,cApiresponceid,cNameasperresponce,cMaker,cChecker) Values ('NBS-000001', 'D1203523',34159,'391','THE KARUR VYSYA BANK LTD','KVBL0004104','110053006','NEW DEL','4104155000001267','SJNITA MANGLIK', 'Savings', 'Y', to_date('18/05/2024 10:34:40','dd/MM/yyyy hh24:mi:ss'),sysdate,'SVR577F4QWKBLX4','SUNITA MANGLIK','7P0xjcr56xLZ0TS1bcaGKQ==',' ') Title : 01~Error Description : Could not find file 'D:\Inetpub\wwwroot\LdMobileService\EkycDocimages\BANKD1203523Image180524103401.png'. Method : UpdateEkycdataLine : 71449 Message : UpdateEkycdata StackTrace : at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) at System.IO.File.InternalReadAllBytes(String path, Boolean checkHost) at ekyc.ekycdata.UpdateEkycdata(Cliole loLdcommon, Int32 tnAngleselection, String tcClientcode, String tcRequstType, String tcMobile, String tcEmailaddress, String tcClientname, String tcFirstname, String tcSecondname, String tcLastname, String tcCorraddressline1, String tcCorraddressline2, String tcCorraddressline3, String tcCorraddresscity, String tnCorrpin, String tcCorrstate, String tcCorrstateother, String tcCorrcountry, String tcCorraddressproof, String tcCorraddressrefid, String tdCorraddressproofissuedt, String tdCorraddressproofexpirydt, String tcPfraddressline1, String tcPfraddressline2, String tcPfraddressline3, String tcPfraddresscity, Int32 tnPfrpin, String tcPfrstate, String tcPfrstateother, String tcPfrcountry, String tcPfraddressproof, String tcPfraddressproofrefid, String tdPfraddressproofissuedt, String tdPfraddressproofexpirydt, String tcResdstatuscode, String tcGender, String tcMaritalstatus, String tcFatherSpousename, String tcNationality, String tcPrefixmaidenname, String tcApplicantMaidenname, String tcPrefixfatherspouse, String tcPrefixmothername, String tcMothername, String tcMothermaidenname, String tcFatcaProofofaddress, String tcFatcaIdnumber, String tcFatcataxresidence, String tcCountryofbirth, String tcCityofbirth, Int64 tnAnnualincome, Int64 tnNetworth, String tdNetworth, String tcDeviceinfo, Int32 tnUpdateKYC, Int32 tnUpdateaddress, Int32 tnUpadateFatca, Int32 tnUpdateMobile, Int32 tnUpdateemail, Int32 tnUpdateBank, Int32 tnUpdateDemat, String tcUserid, String tcFatherHusbandflag, String tpDocimageforAddress, String tpDocimageforKYC, String tpDocimageforFatca, String tcBankdetails, String tpDocimageforBank, String tcDematdetails, String tpDocimageforDemat, String tcOccupation, String tcEsigneddoneby, Int64& tnEkycDocumentno, String tcFilepath, String tcAddressasperKyc, Int64 tnEkycreferenceno, String tcUseraction, String tcIdentifier, String tcEsignPdffilename, String& tceSigndocumentid, Cliole loCCMcon, String tcEsignmethod, String tcEmailFamily, String tcEconfirmation, String tcMobilefamily, Int32 tnUpdateOtherdetails, String tdDOB, String tcAadharnumber, String tceducation, String tcInternettradingflag, String tcDPfees, String tcIBTdetails, String tcIPVproofdetails, String tcDepository, Int32 tnInternetsoftware, String tcKRAAddressIPV, Boolean tlEsignwithClientname, Int32 tnUpdatenominee, String tcNomineedetails, String tcNomineeproof, String tcClientSignaturefile, String tcNomineeopted, String tcNomineeoptout, Int32 tnUpdateSegment, String tcSegmentActivationdetails, String tcSegmentDeActivationdetails, String tcSegmentproofdetails, String tcSchemecode, String tcEsigncoordinator, String tcsubcategoryforcomm, String tcCommodiyitemlist, String tcDerConsentgiven) in File25:line 71449 Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 783216640 Shut down : N Username : MOBBO Date/Time : 18/05/2024 10:35:52 AM Connection : Closed =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKRC209Image180524103607.png$N$~ Message : UpdateEkycdata StackTrace : tpDocimageforBank Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 797040640 Shut down : N Username : MOBBO Date/Time : 18/05/2024 10:36:20 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKRC209Image180524103607.png$N$ Message : UpdateEkycdata StackTrace : lcDocsrtring[i] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 797040640 Shut down : N Username : MOBBO Date/Time : 18/05/2024 10:36:20 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKRC209Image180524103607.png Message : UpdateEkycdata StackTrace : lcProoffile[0] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 797040640 Shut down : N Username : MOBBO Date/Time : 18/05/2024 10:36:20 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKD1203523Image180524103401.png$N$~ Message : UpdateEkycdata StackTrace : tpDocimageforBank Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 811548672 Shut down : N Username : MOBBO Date/Time : 18/05/2024 10:38:04 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKD1203523Image180524103401.png$N$ Message : UpdateEkycdata StackTrace : lcDocsrtring[i] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 811573248 Shut down : N Username : MOBBO Date/Time : 18/05/2024 10:38:04 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKD1203523Image180524103401.png Message : UpdateEkycdata StackTrace : lcProoffile[0] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 811597824 Shut down : N Username : MOBBO Date/Time : 18/05/2024 10:38:04 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Merge into tblCCMekycbankchqrmkr@lnk_ccm T1 using ( Select 'NBS-000001' as cFirmnumber, 'D1203523' as cClientcode,34161 as nEkycrefno from dual ) T2 on (T1.cFirmnumber=T2.cFirmnumber and T1.cClientcode=T2.cClientcode and T1.nEkycdoucmentno=T2.nEkycrefno) when matched then update set cBankcode='391',cBankname='THE KARUR VYSYA BANK LTD',cIfsccode='KVBL0004104',cMicrcode='110053006',cBranchname='NEW DEL',cBankacno='4104155000001267', cChqprintname='SJNITA MANGLIK', cbankactype='Savings', cDefaultbank='Y', dApiverificationstart=to_date('18/05/2024 10:34:40','dd/MM/yyyy hh24:mi:ss'),dApiresponcerecd=sysdate,cApiresponceid='SVR577F4QWKBLX4', cNameasperresponce='SUNITA MANGLIK',cMaker='7P0xjcr56xLZ0TS1bcaGKQ==' when not matched then Insert (cFirmnumber,cClientcode,nEkycdoucmentno,cBankcode,cBankname,cIfsccode,cMicrcode,cBranchname,cBankacno,cChqprintname, cbankactype,cDefaultbank, dApiverificationstart,dApiresponcerecd,cApiresponceid,cNameasperresponce,cMaker,cChecker) Values ('NBS-000001', 'D1203523',34161,'391','THE KARUR VYSYA BANK LTD','KVBL0004104','110053006','NEW DEL','4104155000001267','SJNITA MANGLIK', 'Savings', 'Y', to_date('18/05/2024 10:34:40','dd/MM/yyyy hh24:mi:ss'),sysdate,'SVR577F4QWKBLX4','SUNITA MANGLIK','7P0xjcr56xLZ0TS1bcaGKQ==',' ') Title : 01~Error Description : Could not find file 'D:\Inetpub\wwwroot\LdMobileService\EkycDocimages\BANKD1203523Image180524103401.png'. Method : UpdateEkycdataLine : 71449 Message : UpdateEkycdata StackTrace : at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) at System.IO.File.InternalReadAllBytes(String path, Boolean checkHost) at ekyc.ekycdata.UpdateEkycdata(Cliole loLdcommon, Int32 tnAngleselection, String tcClientcode, String tcRequstType, String tcMobile, String tcEmailaddress, String tcClientname, String tcFirstname, String tcSecondname, String tcLastname, String tcCorraddressline1, String tcCorraddressline2, String tcCorraddressline3, String tcCorraddresscity, String tnCorrpin, String tcCorrstate, String tcCorrstateother, String tcCorrcountry, String tcCorraddressproof, String tcCorraddressrefid, String tdCorraddressproofissuedt, String tdCorraddressproofexpirydt, String tcPfraddressline1, String tcPfraddressline2, String tcPfraddressline3, String tcPfraddresscity, Int32 tnPfrpin, String tcPfrstate, String tcPfrstateother, String tcPfrcountry, String tcPfraddressproof, String tcPfraddressproofrefid, String tdPfraddressproofissuedt, String tdPfraddressproofexpirydt, String tcResdstatuscode, String tcGender, String tcMaritalstatus, String tcFatherSpousename, String tcNationality, String tcPrefixmaidenname, String tcApplicantMaidenname, String tcPrefixfatherspouse, String tcPrefixmothername, String tcMothername, String tcMothermaidenname, String tcFatcaProofofaddress, String tcFatcaIdnumber, String tcFatcataxresidence, String tcCountryofbirth, String tcCityofbirth, Int64 tnAnnualincome, Int64 tnNetworth, String tdNetworth, String tcDeviceinfo, Int32 tnUpdateKYC, Int32 tnUpdateaddress, Int32 tnUpadateFatca, Int32 tnUpdateMobile, Int32 tnUpdateemail, Int32 tnUpdateBank, Int32 tnUpdateDemat, String tcUserid, String tcFatherHusbandflag, String tpDocimageforAddress, String tpDocimageforKYC, String tpDocimageforFatca, String tcBankdetails, String tpDocimageforBank, String tcDematdetails, String tpDocimageforDemat, String tcOccupation, String tcEsigneddoneby, Int64& tnEkycDocumentno, String tcFilepath, String tcAddressasperKyc, Int64 tnEkycreferenceno, String tcUseraction, String tcIdentifier, String tcEsignPdffilename, String& tceSigndocumentid, Cliole loCCMcon, String tcEsignmethod, String tcEmailFamily, String tcEconfirmation, String tcMobilefamily, Int32 tnUpdateOtherdetails, String tdDOB, String tcAadharnumber, String tceducation, String tcInternettradingflag, String tcDPfees, String tcIBTdetails, String tcIPVproofdetails, String tcDepository, Int32 tnInternetsoftware, String tcKRAAddressIPV, Boolean tlEsignwithClientname, Int32 tnUpdatenominee, String tcNomineedetails, String tcNomineeproof, String tcClientSignaturefile, String tcNomineeopted, String tcNomineeoptout, Int32 tnUpdateSegment, String tcSegmentActivationdetails, String tcSegmentDeActivationdetails, String tcSegmentproofdetails, String tcSchemecode, String tcEsigncoordinator, String tcsubcategoryforcomm, String tcCommodiyitemlist, String tcDerConsentgiven) in File25:line 71449 Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 811810816 Shut down : N Username : MOBBO Date/Time : 18/05/2024 10:38:04 AM Connection : Closed =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKD1203523Image180524103401.png$N$~ Message : UpdateEkycdata StackTrace : tpDocimageforBank Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 920104960 Shut down : N Username : MOBBO Date/Time : 18/05/2024 10:40:01 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKD1203523Image180524103401.png$N$ Message : UpdateEkycdata StackTrace : lcDocsrtring[i] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 920104960 Shut down : N Username : MOBBO Date/Time : 18/05/2024 10:40:01 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKD1203523Image180524103401.png Message : UpdateEkycdata StackTrace : lcProoffile[0] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 920104960 Shut down : N Username : MOBBO Date/Time : 18/05/2024 10:40:01 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Merge into tblCCMekycbankchqrmkr@lnk_ccm T1 using ( Select 'NBS-000001' as cFirmnumber, 'D1203523' as cClientcode,34162 as nEkycrefno from dual ) T2 on (T1.cFirmnumber=T2.cFirmnumber and T1.cClientcode=T2.cClientcode and T1.nEkycdoucmentno=T2.nEkycrefno) when matched then update set cBankcode='391',cBankname='THE KARUR VYSYA BANK LTD',cIfsccode='KVBL0004104',cMicrcode='110053006',cBranchname='NEW DEL',cBankacno='4104155000001267', cChqprintname='SJNITA MANGLIK', cbankactype='Savings', cDefaultbank='Y', dApiverificationstart=to_date('18/05/2024 10:34:40','dd/MM/yyyy hh24:mi:ss'),dApiresponcerecd=sysdate,cApiresponceid='SVR577F4QWKBLX4', cNameasperresponce='SUNITA MANGLIK',cMaker='7P0xjcr56xLZ0TS1bcaGKQ==' when not matched then Insert (cFirmnumber,cClientcode,nEkycdoucmentno,cBankcode,cBankname,cIfsccode,cMicrcode,cBranchname,cBankacno,cChqprintname, cbankactype,cDefaultbank, dApiverificationstart,dApiresponcerecd,cApiresponceid,cNameasperresponce,cMaker,cChecker) Values ('NBS-000001', 'D1203523',34162,'391','THE KARUR VYSYA BANK LTD','KVBL0004104','110053006','NEW DEL','4104155000001267','SJNITA MANGLIK', 'Savings', 'Y', to_date('18/05/2024 10:34:40','dd/MM/yyyy hh24:mi:ss'),sysdate,'SVR577F4QWKBLX4','SUNITA MANGLIK','7P0xjcr56xLZ0TS1bcaGKQ==',' ') Title : 01~Error Description : Could not find file 'D:\Inetpub\wwwroot\LdMobileService\EkycDocimages\BANKD1203523Image180524103401.png'. Method : UpdateEkycdataLine : 71449 Message : UpdateEkycdata StackTrace : at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) at System.IO.File.InternalReadAllBytes(String path, Boolean checkHost) at ekyc.ekycdata.UpdateEkycdata(Cliole loLdcommon, Int32 tnAngleselection, String tcClientcode, String tcRequstType, String tcMobile, String tcEmailaddress, String tcClientname, String tcFirstname, String tcSecondname, String tcLastname, String tcCorraddressline1, String tcCorraddressline2, String tcCorraddressline3, String tcCorraddresscity, String tnCorrpin, String tcCorrstate, String tcCorrstateother, String tcCorrcountry, String tcCorraddressproof, String tcCorraddressrefid, String tdCorraddressproofissuedt, String tdCorraddressproofexpirydt, String tcPfraddressline1, String tcPfraddressline2, String tcPfraddressline3, String tcPfraddresscity, Int32 tnPfrpin, String tcPfrstate, String tcPfrstateother, String tcPfrcountry, String tcPfraddressproof, String tcPfraddressproofrefid, String tdPfraddressproofissuedt, String tdPfraddressproofexpirydt, String tcResdstatuscode, String tcGender, String tcMaritalstatus, String tcFatherSpousename, String tcNationality, String tcPrefixmaidenname, String tcApplicantMaidenname, String tcPrefixfatherspouse, String tcPrefixmothername, String tcMothername, String tcMothermaidenname, String tcFatcaProofofaddress, String tcFatcaIdnumber, String tcFatcataxresidence, String tcCountryofbirth, String tcCityofbirth, Int64 tnAnnualincome, Int64 tnNetworth, String tdNetworth, String tcDeviceinfo, Int32 tnUpdateKYC, Int32 tnUpdateaddress, Int32 tnUpadateFatca, Int32 tnUpdateMobile, Int32 tnUpdateemail, Int32 tnUpdateBank, Int32 tnUpdateDemat, String tcUserid, String tcFatherHusbandflag, String tpDocimageforAddress, String tpDocimageforKYC, String tpDocimageforFatca, String tcBankdetails, String tpDocimageforBank, String tcDematdetails, String tpDocimageforDemat, String tcOccupation, String tcEsigneddoneby, Int64& tnEkycDocumentno, String tcFilepath, String tcAddressasperKyc, Int64 tnEkycreferenceno, String tcUseraction, String tcIdentifier, String tcEsignPdffilename, String& tceSigndocumentid, Cliole loCCMcon, String tcEsignmethod, String tcEmailFamily, String tcEconfirmation, String tcMobilefamily, Int32 tnUpdateOtherdetails, String tdDOB, String tcAadharnumber, String tceducation, String tcInternettradingflag, String tcDPfees, String tcIBTdetails, String tcIPVproofdetails, String tcDepository, Int32 tnInternetsoftware, String tcKRAAddressIPV, Boolean tlEsignwithClientname, Int32 tnUpdatenominee, String tcNomineedetails, String tcNomineeproof, String tcClientSignaturefile, String tcNomineeopted, String tcNomineeoptout, Int32 tnUpdateSegment, String tcSegmentActivationdetails, String tcSegmentDeActivationdetails, String tcSegmentproofdetails, String tcSchemecode, String tcEsigncoordinator, String tcsubcategoryforcomm, String tcCommodiyitemlist, String tcDerConsentgiven) in File25:line 71449 Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 920113152 Shut down : N Username : MOBBO Date/Time : 18/05/2024 10:40:01 AM Connection : Closed =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKY9960151Image180524110904.png$N$~ Message : UpdateEkycdata StackTrace : tpDocimageforBank Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 912773120 Shut down : N Username : MOBBO Date/Time : 18/05/2024 11:09:28 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKY9960151Image180524110904.png$N$ Message : UpdateEkycdata StackTrace : lcDocsrtring[i] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 912789504 Shut down : N Username : MOBBO Date/Time : 18/05/2024 11:09:28 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKY9960151Image180524110904.png Message : UpdateEkycdata StackTrace : lcProoffile[0] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 912789504 Shut down : N Username : MOBBO Date/Time : 18/05/2024 11:09:28 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKW1850004Image180524111327.png$N$~ Message : UpdateEkycdata StackTrace : tpDocimageforBank Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 659038208 Shut down : N Username : MOBBO Date/Time : 18/05/2024 11:14:12 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKW1850004Image180524111327.png$N$ Message : UpdateEkycdata StackTrace : lcDocsrtring[i] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 659054592 Shut down : N Username : MOBBO Date/Time : 18/05/2024 11:14:12 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKW1850004Image180524111327.png Message : UpdateEkycdata StackTrace : lcProoffile[0] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 659054592 Shut down : N Username : MOBBO Date/Time : 18/05/2024 11:14:12 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKL2940033Image180524112737.png$N$~ Message : UpdateEkycdata StackTrace : tpDocimageforBank Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 1213702144 Shut down : N Username : MOBBO Date/Time : 18/05/2024 11:27:49 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKL2940033Image180524112737.png$N$ Message : UpdateEkycdata StackTrace : lcDocsrtring[i] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 1213718528 Shut down : N Username : MOBBO Date/Time : 18/05/2024 11:27:49 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKL2940033Image180524112737.png Message : UpdateEkycdata StackTrace : lcProoffile[0] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 1213718528 Shut down : N Username : MOBBO Date/Time : 18/05/2024 11:27:49 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Select tblFirmcreation.cshortname as cShortname From tblFirmcreation tblFirmcreation Where tblFirmcreation.cUserFirmcode='NBS-000001' Title : 01~Error Description : Value cannot be null. Parameter name: dataTable Method : AgeingacrossyearLine : 46316 Message : Ageingacrossyear StackTrace : at System.Data.Common.DataAdapter.Fill(DataTable[] dataTables, IDataReader dataReader, Int32 startRecord, Int32 maxRecords) at Oracle.ManagedDataAccess.Client.OracleDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable) at clientlevel.Thinclientlevel.Clientlogin.Ageingacrossyear(DateTime tdTransactiondate, Int32 tnTotaldays1, Int32 tnTotaldays2, Int32 tnTotaldays3, Int32 tnAngleselection, Int32 tnTotaldays4, Int32 tnTotaldays5, Int32 tnTotaldays6, Cliole loLdcommon, Int32 tnTotaldays7, Int32 tnTotaldays8, Int32 tnTotaldays9, Int32 tnTotaldays10, Int32 tnTotaldays11, Int32 tnTotaldays12, Int32 tnIncludepreviousyear, Int32 tnIgnorebounced, Int32 tnonlyReconciledentries, Int32 tnTerminalcodejoin, String& tcCashpayindate, String& tcFopayindate, Int32 tnAgeingonTransactiondate, String tcClientcode, Double tnAmount, String& tcSebiageingdate) in File25:line 46316 Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 1143771136 Shut down : N Username : MOBBO Date/Time : 18/05/2024 11:28:01 AM Connection : Closed =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Select tblFirmcreation.cshortname as cShortname From tblFirmcreation tblFirmcreation Where tblFirmcreation.cUserFirmcode='NBS-000001' Title : 01~Error Description : Value cannot be null. Parameter name: dataTable Method : AgeingacrossyearLine : 46316 Message : Ageingacrossyear StackTrace : at System.Data.Common.DataAdapter.Fill(DataTable[] dataTables, IDataReader dataReader, Int32 startRecord, Int32 maxRecords) at Oracle.ManagedDataAccess.Client.OracleDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable) at clientlevel.Thinclientlevel.Clientlogin.Ageingacrossyear(DateTime tdTransactiondate, Int32 tnTotaldays1, Int32 tnTotaldays2, Int32 tnTotaldays3, Int32 tnAngleselection, Int32 tnTotaldays4, Int32 tnTotaldays5, Int32 tnTotaldays6, Cliole loLdcommon, Int32 tnTotaldays7, Int32 tnTotaldays8, Int32 tnTotaldays9, Int32 tnTotaldays10, Int32 tnTotaldays11, Int32 tnTotaldays12, Int32 tnIncludepreviousyear, Int32 tnIgnorebounced, Int32 tnonlyReconciledentries, Int32 tnTerminalcodejoin, String& tcCashpayindate, String& tcFopayindate, Int32 tnAgeingonTransactiondate, String tcClientcode, Double tnAmount, String& tcSebiageingdate) in File25:line 46316 Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 1144143872 Shut down : N Username : MOBBO Date/Time : 18/05/2024 11:28:05 AM Connection : Closed =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKNVSDB90Image180524114500.png$N$~ Message : UpdateEkycdata StackTrace : tpDocimageforBank Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 703983616 Shut down : N Username : MOBBO Date/Time : 18/05/2024 11:45:19 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKNVSDB90Image180524114500.png$N$ Message : UpdateEkycdata StackTrace : lcDocsrtring[i] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 704000000 Shut down : N Username : MOBBO Date/Time : 18/05/2024 11:45:19 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKNVSDB90Image180524114500.png Message : UpdateEkycdata StackTrace : lcProoffile[0] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 704000000 Shut down : N Username : MOBBO Date/Time : 18/05/2024 11:45:19 AM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Select tblFirmcreation.cshortname as cShortname From tblFirmcreation tblFirmcreation Where tblFirmcreation.cUserFirmcode='NBC-000001' Title : 01~Error Description : Value cannot be null. Parameter name: dataTable Method : AgeingacrossyearLine : 46316 Message : Ageingacrossyear StackTrace : at System.Data.Common.DataAdapter.Fill(DataTable[] dataTables, IDataReader dataReader, Int32 startRecord, Int32 maxRecords) at Oracle.ManagedDataAccess.Client.OracleDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable) at clientlevel.Thinclientlevel.Clientlogin.Ageingacrossyear(DateTime tdTransactiondate, Int32 tnTotaldays1, Int32 tnTotaldays2, Int32 tnTotaldays3, Int32 tnAngleselection, Int32 tnTotaldays4, Int32 tnTotaldays5, Int32 tnTotaldays6, Cliole loLdcommon, Int32 tnTotaldays7, Int32 tnTotaldays8, Int32 tnTotaldays9, Int32 tnTotaldays10, Int32 tnTotaldays11, Int32 tnTotaldays12, Int32 tnIncludepreviousyear, Int32 tnIgnorebounced, Int32 tnonlyReconciledentries, Int32 tnTerminalcodejoin, String& tcCashpayindate, String& tcFopayindate, Int32 tnAgeingonTransactiondate, String tcClientcode, Double tnAmount, String& tcSebiageingdate) in File25:line 46316 Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 397520896 Shut down : N Username : MOBBO Date/Time : 18/05/2024 12:14:18 PM Connection : Closed =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : Message : UpdateEkycdata StackTrace : tpDocimageforBank Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 398077952 Shut down : N Username : MOBBO Date/Time : 18/05/2024 12:14:19 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : BO910 With tbltempReport as (Select '01' as cRowindicator, 'Opening Market Value' as cRowdesc From Dual Union All Select '02' as cRowindicator, 'Capital In(+)/Out(-)' as cRowdesc From Dual Union All Select '03' as cRowindicator, Rpad(' ',8)||'Realized Profit (+)/(-)' as cRowdesc From dual Union All Select '04' as cRowindicator, 'Cash Segment' as cRowdesc From dual Union All Select '05' as cRowindicator, 'Derivatives Segment' as cRowdesc From dual Union All Select '06' as cRowindicator, 'Total Realized Profit(+)/(-) ' as cRowdesc From dual Union All Select '07' as cRowindicator, Rpad(' ',8)||'Un-Realized Profit (+)/(-) ' as cRowdesc From dual Union All Select '08' as cRowindicator, 'Cash Segment' as cRowdesc From dual Union All Select '09' as cRowindicator, 'Derivatives Segment' as cRowdesc From dual Union All Select '10' as cRowindicator, 'Total Un-Realized Profit(+)/(-) ' as cRowdesc From dual Union All Select '11' as cRowindicator, 'Total Dividend Amount' as cRowdesc From dual Union All Select '12' as cRowindicator, Rpad(' ',8)||'Statutory Charges' as cRowdesc From dual Union All Select '13' as cRowindicator, 'Cash Segment' as cRowdesc From dual Union All Select '14' as cRowindicator, 'Derivatives Segment' as cRowdesc From dual Union All Select '15' as cRowindicator, 'Misc. JV Entries' as cRowdesc From dual Union All Select '16' as cRowindicator, 'Direct Dividend Credit' as cRowdesc From dual Union All Select '17' as cRowindicator, 'Total Portfolio Allocation' as cRowdesc From dual Union All Select '18' as cRowindicator, 'Total No. of Days' as cRowdesc From dual Union All Select '19' as cRowindicator, 'Absolute Return' as cRowdesc From dual Union All Select '20' as cRowindicator, 'Annualized Return' as cRowdesc From dual Union All Select '24' as cRowindicator, Rpad(' ',8)||'Portfolio Allocation' as cRowdesc From dual Union All Select '25' as cRowindicator, 'Equity' as cRowdesc From dual Union All Select '26' as cRowindicator, 'Cash and Equivalent' as cRowdesc From dual Union All Select '27' as cRowindicator, 'Total Portfolio Allocation' as cRowdesc From dual ), tblReportdesc as (Select Ldfibs.Oowncode as cClientcode, tbltempReport.* From Ldfibs Ldfibs Left Outer Join tbltempReport On 1=1 Where Ldfibs.Firmnumber='NBS-000001' and (Ldfibs.Oowncode='BO910') and Ldfibs.Brcode='143' ), tblOpendet as (Select Ledger.Oowncode as cClientcode, '01' as cRowindicator, Sum(Ledger.Damount-Ledger.Camount)*-1 as nSecamount From Ledger Ledger Where Ledger.Firmnumber='NBS-000001' and Ledger.nFinancialyear=2024 and (Ledger.Oowncode='BO910') and Ledger.Branchcode='143' and Substr(Ledger.Voucher,1,4)='OPNG' group by Ledger.Oowncode Union All Select Sauda.Oowncode as cClientcode, '01' as cRowindicator, Sum(Sauda.Quantity*Sauda.Market) as nSecamount From Sauda Sauda Where Sauda.Egroup='OK' and Sauda.Firmnumber = 'NBS-000001' and (Sauda.Oowncode='BO910') and Sauda.Brcode='143' group by Sauda.Oowncode ), tblOpenstk as (Select tblOpendet.cClientcode as cClientcode, Max(tblOpendet.cRowindicator) as cRowindicator, 0 as nFiramount, Sum(tblOpendet.nSecamount) as nSecamount From tblOpendet tblOpendet group by tblOpendet.cClientcode), tblCapinout as (Select Ledger.Oowncode as cClientcode, '02' as cRowindicator, 0 as nFiramount, Sum(Ledger.Damount-Ledger.Camount)*-1 as nSecamount From Ledger Ledger Where Ledger.Firmnumber='NBS-000001' and Ledger.nFinancialyear=2024 and (Ledger.Oowncode='BO910') and Ledger.Branchcode='143' and Ledger.Dtoftran>=to_date('01/04/2023','dd/mm/yyyy') and Ledger.Dtoftran<=to_date('31/03/2024','dd/mm/yyyy') and (Substr(Ledger.Voucher,1,2)='RE' or Substr(Ledger.Voucher,1,2)='PY') group by Ledger.Oowncode ), tblFinledger as (Select Ledger.Oowncode as cClientcode, '26' as cRowindicator, Sum(Ledger.Damount-Ledger.Camount)*-1 as nFiramount, 0 as nSecamount From Ledger Ledger Where Ledger.Firmnumber='NBS-000001' and Ledger.nFinancialyear=2024 and (Ledger.Oowncode='BO910') and Ledger.Branchcode='143' and Ledger.Dtoftran>=to_date('01/04/2023','dd/mm/yyyy') and Ledger.Dtoftran<=to_date('31/03/2024','dd/mm/yyyy') group by Ledger.Oowncode ), tblCashinternal as (Select Sauda.Oowncode as cClientcode, Sauda.Compcode as cScripcode, Sauda.Dtoftran as dBuydate, Sauda.BuySell as cBuysell, Sum(Sauda.Quantity) as nBuyquantity, Case When Sum(Sauda.Brokpercontract) = 0 Then Avg(Sauda.Final_Rat1) Else Case When Sauda.BuySell = 'B' Then Round(((Sum(Sauda.Quantity) * Avg(Sauda.Final_Rat1)) + Sum(Sauda.Brokpercontract)) / Sum(Sauda.Quantity), 10) Else Round(((Sum(Sauda.Quantity) * Avg(Sauda.Final_Rat1)) - Sum(Sauda.Brokpercontract)) / Sum(Sauda.Quantity), 10) End End as nBuynetrate, Sum(Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, Sauda.Quantity * -1))) Over(Partition By Sauda.Oowncode, Sauda.Compcode Order By Sauda.Dtoftran, Sauda.Final_Rat1 rows between current row and unbounded following) as nRunningqty, Sum(Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, 0))) Over(Partition By Sauda.Oowncode, Sauda.Compcode Order By Sauda.Dtoftran, Sauda.Final_Rat1 rows between current row and unbounded following) as nRunningbuytotal, Sum(Sum(Decode(Sauda.Buysell, 'S', Sauda.Quantity, 0))) Over(Partition By Sauda.Oowncode, Sauda.Compcode Order By Sauda.Dtoftran, Sauda.Final_Rat1 rows between current row and unbounded following) as nRunningselltotal, Sum(Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, 0))) Over(Partition By Sauda.Oowncode, Sauda.Compcode) as nSummarybuy, Sum(Sum(Decode(Sauda.Buysell, 'S', Sauda.Quantity, 0))) Over(Partition By Sauda.Oowncode, Sauda.Compcode) as nSummarysell, Sum(Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, 0)) * Case When Sum(Sauda.Brokpercontract) = 0 Then Avg(Sauda.Final_Rat1) Else Case When Sauda.BuySell = 'B' Then Round(((Sum(Sauda.Quantity) * Avg(Sauda.Final_Rat1)) + Sum(Sauda.Brokpercontract)) / Sum(Sauda.Quantity), 10) Else 0 End End) Over(Partition By Sauda.Oowncode, Sauda.Compcode) as nSumBuyamount, Sum(Sum(Decode(Sauda.Buysell, 'S', Sauda.Quantity, 0)) * Case When Sum(Sauda.Brokpercontract) = 0 Then Avg(Sauda.Final_Rat1) Else Case When Sauda.BuySell = 'B' Then 0 Else Round(((Sum(Sauda.Quantity) * Avg(Sauda.Final_Rat1)) - Sum(Sauda.Brokpercontract)) / Sum(Sauda.Quantity), 10) End End) Over(Partition By Sauda.Oowncode, Sauda.Compcode) as nSumSellamount, Sum(Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, Sauda.Quantity * -1))) Over(Partition By Sauda.Oowncode, Sauda.Compcode) As nNetquantity From Sauda Sauda Where Sauda.Firmnumber='NBS-000001' and Sauda.Egroup!='YC' and Sauda.Egroup != 'LB' and Sauda.Egroup != 'SR' and Sauda.Egroup != 'LA' and Sauda.Sterminal != '99999' and Sauda.Dtoftran 0 Then Case When tblCashinternal.nRunningbuytotal > tblCashinternal.nNetquantity Then tblCashinternal.nNetquantity + tblCashinternal.nBuyquantity - tblCashinternal.nRunningbuytotal Else tblCashinternal.nBuyquantity End When tblCashinternal.nNetquantity < 0 Then Case When Abs(tblCashinternal.nRunningselltotal) > Abs(tblCashinternal.nNetquantity) Then tblCashinternal.nNetquantity - tblCashinternal.nBuyquantity + tblCashinternal.nRunningselltotal Else tblCashinternal.nBuyquantity * -1 End End) as nOpStockquantity, Sum((Case When tblCashinternal.nNetquantity = 0 Then 0 When tblCashinternal.nNetquantity > 0 Then Case When tblCashinternal.nRunningbuytotal > tblCashinternal.nNetquantity Then tblCashinternal.nNetquantity + tblCashinternal.nBuyquantity - tblCashinternal.nRunningbuytotal Else tblCashinternal.nBuyquantity End When tblCashinternal.nNetquantity < 0 Then Case When Abs(tblCashinternal.nRunningselltotal) > Abs(tblCashinternal.nNetquantity) Then tblCashinternal.nNetquantity - tblCashinternal.nBuyquantity + tblCashinternal.nRunningselltotal Else tblCashinternal.nBuyquantity * -1 End End) * tblCashinternal.nBuynetrate) as nOpStockAmount from tblCashinternal Where (tblCashinternal.nNetquantity > 0 And tblCashinternal.cBuysell = 'B' And tblCashinternal.nRunningbuytotal <= tblCashinternal.nNetquantity + tblCashinternal.nBuyquantity) or (tblCashinternal.nNetquantity < 0 and tblCashinternal.cBuysell = 'S' and Abs(tblCashinternal.nRunningselltotal) <= Abs(tblCashinternal.nNetquantity) + tblCashinternal.nBuyquantity) Group By tblCashinternal.cClientcode, tblCashinternal.cScripcode), tblCashinternal1 as (Select Sauda.Oowncode as cClientcode, Sauda.Compcode as cScripcode, Sauda.Dtoftran as dBuydate, Sauda.BuySell as cBuysell, Sum(Sauda.Quantity) as nBuyquantity, Case When Sum(Sauda.Brokpercontract) = 0 Then Avg(Sauda.Final_Rat1) Else Case When Sauda.BuySell = 'B' Then Round(((Sum(Sauda.Quantity) * Avg(Sauda.Final_Rat1)) + Sum(Sauda.Brokpercontract)) / Sum(Sauda.Quantity), 10) Else Round(((Sum(Sauda.Quantity) * Avg(Sauda.Final_Rat1)) - Sum(Sauda.Brokpercontract)) / Sum(Sauda.Quantity), 10) End End as nBuynetrate, Sum(Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, Sauda.Quantity * -1))) Over(Partition By Sauda.Oowncode, Sauda.Compcode Order By Sauda.Dtoftran, Sauda.Final_Rat1 rows between current row and unbounded following) as nRunningqty, Sum(Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, 0))) Over(Partition By Sauda.Oowncode, Sauda.Compcode Order By Sauda.Dtoftran, Sauda.Final_Rat1 rows between current row and unbounded following) as nRunningbuytotal, Sum(Sum(Decode(Sauda.Buysell, 'S', Sauda.Quantity, 0))) Over(Partition By Sauda.Oowncode, Sauda.Compcode Order By Sauda.Dtoftran, Sauda.Final_Rat1 rows between current row and unbounded following) as nRunningselltotal, Sum(Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, 0))) Over(Partition By Sauda.Oowncode, Sauda.Compcode) as nSummarybuy, Sum(Sum(Decode(Sauda.Buysell, 'S', Sauda.Quantity, 0))) Over(Partition By Sauda.Oowncode, Sauda.Compcode) as nSummarysell, Sum(Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, 0)) * Case When Sum(Sauda.Brokpercontract) = 0 Then Avg(Sauda.Final_Rat1) Else Case When Sauda.BuySell = 'B' Then Round(((Sum(Sauda.Quantity) * Avg(Sauda.Final_Rat1)) + Sum(Sauda.Brokpercontract)) / Sum(Sauda.Quantity), 10) Else 0 End End) Over(Partition By Sauda.Oowncode, Sauda.Compcode) as nSumBuyamount, Sum(Sum(Decode(Sauda.Buysell, 'S', Sauda.Quantity, 0)) * Case When Sum(Sauda.Brokpercontract) = 0 Then Avg(Sauda.Final_Rat1) Else Case When Sauda.BuySell = 'B' Then 0 Else Round(((Sum(Sauda.Quantity) * Avg(Sauda.Final_Rat1)) - Sum(Sauda.Brokpercontract)) / Sum(Sauda.Quantity), 10) End End) Over(Partition By Sauda.Oowncode, Sauda.Compcode) as nSumSellamount, Sum(Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, Sauda.Quantity * -1))) Over(Partition By Sauda.Oowncode, Sauda.Compcode) As nNetquantity From Sauda Sauda Where Sauda.Firmnumber='NBS-000001' and Sauda.Egroup!='YC' and Sauda.Egroup != 'LB' and Sauda.Egroup != 'SR' and Sauda.Egroup != 'LA' and Sauda.Sterminal != '99999' and Sauda.Dtoftran<=to_date('31/03/2024','dd/mm/yyyy') and Sauda.Brcode='143' and (Sauda.Oowncode='BO910') group by Sauda.Oowncode, Sauda.Dtoftran, Sauda.Final_Rat1, Sauda.buysell, Sauda.Compcode), tblClosing as (Select tblCashinternal1.cClientcode as cClientcode, tblCashinternal1.cScripcode as cScripcode, Sum(Case When tblCashinternal1.nNetquantity = 0 Then 0 When tblCashinternal1.nNetquantity > 0 Then Case When tblCashinternal1.nRunningbuytotal > tblCashinternal1.nNetquantity Then tblCashinternal1.nNetquantity + tblCashinternal1.nBuyquantity - tblCashinternal1.nRunningbuytotal Else tblCashinternal1.nBuyquantity End When tblCashinternal1.nNetquantity < 0 Then Case When Abs(tblCashinternal1.nRunningselltotal) > Abs(tblCashinternal1.nNetquantity) Then tblCashinternal1.nNetquantity - tblCashinternal1.nBuyquantity + tblCashinternal1.nRunningselltotal Else tblCashinternal1.nBuyquantity * -1 End End) AS nCLStockquantity, Sum((Case When tblCashinternal1.nNetquantity = 0 Then 0 When tblCashinternal1.nNetquantity > 0 Then Case When tblCashinternal1.nRunningbuytotal > tblCashinternal1.nNetquantity Then tblCashinternal1.nNetquantity + tblCashinternal1.nBuyquantity - tblCashinternal1.nRunningbuytotal Else tblCashinternal1.nBuyquantity End When tblCashinternal1.nNetquantity < 0 Then Case When Abs(tblCashinternal1.nRunningselltotal) > Abs(tblCashinternal1.nNetquantity) Then tblCashinternal1.nNetquantity - tblCashinternal1.nBuyquantity + tblCashinternal1.nRunningselltotal Else tblCashinternal1.nBuyquantity * -1 End End) * tblCashinternal1.nBuynetrate) as nClStockAmount from tblCashinternal1 Where (tblCashinternal1.nNetquantity > 0 And tblCashinternal1.cBuysell = 'B' And tblCashinternal1.nRunningbuytotal <= tblCashinternal1.nNetquantity + tblCashinternal1.nBuyquantity) or (tblCashinternal1.nNetquantity < 0 and tblCashinternal1.cBuysell = 'S' and Abs(tblCashinternal1.nRunningselltotal) <= Abs(tblCashinternal1.nNetquantity) + tblCashinternal1.nBuyquantity) Group By tblCashinternal1.cClientcode, tblCashinternal1.cScripcode), tblBuYSell as (Select Sauda.Oowncode as cClientcode, Sauda.Compcode as cScripcode, Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, 0)) as nbuyQty, Sum(Decode(Sauda.Buysell, 'S', Sauda.Quantity, 0)) as nsellQty, Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity * Sauda.Final_Rat1 , 0)+Case When Sauda.Buysell='B' then Sauda.Brokpercontract else 0 end) as nBuyamount, Sum(Decode(Sauda.Buysell, 'S', Sauda.Quantity * Sauda.Final_Rat1 , 0)-Case When Sauda.Buysell='S' then Sauda.Brokpercontract else 0 end) as nSellamount From Sauda Sauda Where Sauda.Firmnumber='NBS-000001' and Sauda.Egroup!='YC' and Sauda.Egroup != 'LB' and Sauda.Egroup != 'SR' and Sauda.Egroup != 'LA' and Sauda.Sterminal != '99999' and Sauda.Dtoftran>=to_date('01/04/2023','dd/mm/yyyy') and Sauda.Dtoftran<=to_Date('31/03/2024','dd/mm/yyyy') and Sauda.Brcode='143' and (Sauda.Oowncode='BO910') group by Sauda.Oowncode, Sauda.Compcode), tblCashcost as (Select Coalesce(tblOpening.cClientcode,tblClosing.cClientcode,tblBuysell.cClientcode) as cClientcode, Coalesce(tblOpening.cScripcode,tblClosing.cScripcode,tblBuysell.cScripcode) as cScripcode, Nvl(tblOpening.nOpstockquantity,0) as nOpstockquantity, Nvl(tblOpening.nOpstockamount,0) as nOpstockamount, Case When Nvl(tblOpening.nOpstockquantity,0)!=0 then Round(Nvl(tblOpening.nOpstockamount,0)/Nvl(tblOpening.nOpstockquantity,0),4) else 0 end as nOpstockavg, Nvl(tblBuysell.nBuyqty,0) as nPrePurchqty, Nvl(tblBuysell.nBuyamount,0) as nPrePurchvalue, Case When Nvl(tblBuysell.nBuyqty,0) !=0 then Round(Nvl(tblBuysell.nBuyamount,0)/Nvl(tblBuysell.nBuyqty,0),4) else 0 end as nPrePurchavg, Nvl(tblBuysell.nSellQty, 0) as nPreSellqty, Nvl(tblBuysell.nSellamount, 0) as nPreSellvalue, Case When Nvl(tblBuysell.nSellQty, 0) != 0 then Round(Nvl(tblBuysell.nSellamount, 0) / Nvl(tblBuysell.nSellQty, 0), 4) else 0 end as nPreSellavg, Least((Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockquantity, 0) + Nvl(tblBuysell.nBuyqty, 0) Else Nvl(tblBuysell.nBuyqty, 0) End), (Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockquantity, 0)) + Nvl(tblBuysell.nSellqty, 0) Else Nvl(tblBuysell.nSellqty, 0) End)) as nPurchqty, Round((Case When (Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockquantity, 0) + Nvl(tblBuysell.nBuyqty, 0) Else Nvl(tblBuysell.nBuyqty, 0) End) <= (Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockquantity, 0)) + Nvl(tblBuysell.nSellqty, 0) Else Nvl(tblBuysell.nSellqty, 0) End) Then Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockAmount, 0) + Nvl(tblBuysell.nBuyAmount, 0) Else Nvl(tblBuysell.nBuyAmount, 0) End Else Nvl(tblBuysell.nBuyAmount, 0) + Nvl(tblOpening.nOpstockAmount, 0) - nvl(tblClosing.nClStockAmount, 0) End), 2) as nPurchvalue, Round((Case When Least((Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockquantity, 0) + Nvl(tblBuysell.nBuyqty, 0) Else Nvl(tblBuysell.nBuyqty, 0) End), (Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockquantity, 0)) + Nvl(tblBuysell.nSellqty, 0) Else Nvl(tblBuysell.nSellqty, 0) End)) != 0 Then (Case When (Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockquantity, 0) + Nvl(tblBuysell.nBuyqty, 0) Else Nvl(tblBuysell.nBuyqty, 0) End) <= (Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockquantity, 0)) + Nvl(tblBuysell.nSellqty, 0) Else Nvl(tblBuysell.nSellqty, 0) End) Then Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockAmount, 0) + Nvl(tblBuysell.nBuyAmount, 0) Else Nvl(tblBuysell.nBuyAmount, 0) End Else Nvl(tblBuysell.nBuyAmount, 0) + Nvl(tblOpening.nOpstockAmount, 0) - nvl(tblClosing.nClStockAmount, 0) End) / (Least((Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockquantity, 0) + Nvl(tblBuysell.nBuyqty, 0) Else Nvl(tblBuysell.nBuyqty, 0) End), (Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockquantity, 0)) + Nvl(tblBuysell.nSellqty, 0) Else Nvl(tblBuysell.nSellqty, 0) End))) Else 0 End), 4) as nPurchavg, Least((Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockquantity, 0) + Nvl(tblBuysell.nBuyqty, 0) Else Nvl(tblBuysell.nBuyqty, 0) End), (Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockquantity, 0)) + Nvl(tblBuysell.nSellqty, 0) Else Nvl(tblBuysell.nSellqty, 0) End)) as nSalesqty, Round((Case When (Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockquantity, 0) + Nvl(tblBuysell.nBuyqty, 0) Else Nvl(tblBuysell.nBuyqty, 0) End) >= (Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockquantity, 0)) + Nvl(tblBuysell.nSellqty, 0) Else Nvl(tblBuysell.nSellqty, 0) End) Then Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockAmount, 0)) + Nvl(tblBuysell.nSellAmount, 0) Else Nvl(tblBuysell.nSellAmount, 0) End Else Nvl(tblBuysell.nSellAmount, 0) - Nvl(tblOpening.nOpstockAmount, 0) + nvl(tblClosing.nClStockAmount, 0) End), 2) as nSalesvalue, Round((Case When Least((Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockquantity, 0) + Nvl(tblBuysell.nBuyqty, 0) Else Nvl(tblBuysell.nBuyqty, 0) End), (Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockquantity, 0)) + Nvl(tblBuysell.nSellqty, 0) Else Nvl(tblBuysell.nSellqty, 0) End)) != 0 Then (Case When (Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockquantity, 0) + Nvl(tblBuysell.nBuyqty, 0) Else Nvl(tblBuysell.nBuyqty, 0) End) >= (Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockquantity, 0)) + Nvl(tblBuysell.nSellqty, 0) Else Nvl(tblBuysell.nSellqty, 0) End) Then Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockAmount, 0)) + Nvl(tblBuysell.nSellAmount, 0) Else Nvl(tblBuysell.nSellAmount, 0) End Else Nvl(tblBuysell.nSellAmount, 0) - Nvl(tblOpening.nOpstockAmount, 0) + nvl(tblClosing.nClStockAmount, 0) End) / (Least((Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockquantity, 0) + Nvl(tblBuysell.nBuyqty, 0) Else Nvl(tblBuysell.nBuyqty, 0) End), (Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockquantity, 0)) + Nvl(tblBuysell.nSellqty, 0) Else Nvl(tblBuysell.nSellqty, 0) End))) ELse 0 End), 4) as nSalesavg, Nvl(tblClosing.nClstockquantity, 0) as nOsstock, Nvl(tblClosing.nClstockamount, 0) as nOsstockvalue, Case When Nvl(tblClosing.nClstockquantity, 0) != 0 then Round(Nvl(tblClosing.nClstockamount, 0) / Nvl(tblClosing.nClstockquantity, 0), 4) else 0 end as nOsstockavg, (nvl(tblBuySell.nSellAmount, 0) - nvl(tblOpening.nOpStockAmount, 0) - nvl(tblBuySell.nBuyAmount, 0) + nvl(tblClosing.nClStockAmount, 0)) as nProfitloss, ((Market.Market * nvl(tblClosing.nClstockquantity, 0)) - Nvl(tblClosing.nClstockamount, 0)) As nUnrealprlo, (nvl(tblBuySell.nSellAmount, 0) - nvl(tblOpening.nOpStockAmount, 0) - nvl(tblBuySell.nBuyAmount, 0) + nvl(tblClosing.nClStockAmount, 0)) + ((Market.Market * nvl(tblClosing.nClstockquantity, 0)) - Nvl(tblClosing.nClstockamount, 0)) As nOverallprlo, Market.Market as nMarketrate, Market.Market*Nvl(tblClosing.nClstockquantity,0) As nMarketvalue from tblOPening tblOpening Full Join TblClosing on tblOpening.cclientcode = tblclosing.cclientcode and tblOPening.cScripcode = tblClosing.cScripcode Full Join TblBuySell on tblBuySell.cclientcode = coalesce(tblOpening.cclientcode, tblclosing.cclientcode) and tblBuySell.cScripcode = coalesce(tblOPening.cScripcode, tblClosing.cScripcode) Left Outer Join Market Market On Market.Firmnumber='NBS-000001' and Market.code=coalesce(tblOpening.cScripcode, tblclosing.cScripcode, tblBuysell.cScripcode) ), tblOpendet as (Select Ledger.Oowncode as cClientcode, '01' as cRowindicator, Sum(Ledger.Damount-Ledger.Camount)*-1 as nSecamount From Ledger Ledger Where Ledger.Firmnumber='NBS-000001' and Ledger.nFinancialyear = 2024 and (Ledger.Oowncode='BO910') and Ledger.Branchcode='143' and Substr(Ledger.Voucher,1,4)='OPNG' group by Ledger.Oowncode Union All Select tblCashcost.cClientcode as cClientcode, '01' as cRowindicator, Sum(tblCashcost.nOpstockamount) as nSecamount From tblCashcost tblCashcost group by tblCashcost.cClientcode ), tblOpenstk as (Select tblOpendet.cClientcode as cClientcode, Max(tblOpendet.cRowindicator) as cRowindicator, 0 as nFiramount, Sum(tblOpendet.nSecamount) as nSecamount From tblOpendet tblOpendet group by tblOpendet.cClientcode), tblPortcashfin as (Select tblCashcost.cClientcode as cClientcode, '04' as cRowindicator, Sum(tblCashcost.nProfitloss) as nFiramount, 0 as nSecamount From tblCashcost tblCashcost group by tblCashcost.cClientcode Union All Select tblCashcost.cClientcode as cClientcode, '25' as cRowindicator, Sum(tblCashcost.nMarketvalue) as nFiramount, 0 as nSecamount From tblCashcost tblCashcost group by tblCashcost.cClientcode Union All Select tblCashcost.cClientcode as cClientcode, '08' as cRowindicator, Sum(tblCashcost.nUnrealprlo) as nFiramount, 0 as nSecamount From tblCashcost tblCashcost group by tblCashcost.cClientcode ), tblFointernal as (Select Fosauda.Oowncode as cClientcode, Fosauda.Compcode as cScripcode, Fosauda.Strikeprice as nStrikeprice, Fosauda.Optiontype as cOptiontype, Company.Fibsacct as cScripname, Company.Expirydate as dExpirydate, Exchange.Operation as cOperation, Company.Instrutyp as cInstrutyp, Company.nBaseunit as nBaseunit, Company.cUnitofmeasurement as cUnitofmeasurement, Company.cUnitofTrading as cUnitofTrading, Company.nTradeablelot as nTradeablelot, Company.nPricenumerator as nPricenumerator, Company.nPricedenominator as nPricedenominator, Company.nGeneralnumerator as nGeneralnumerator, Company.nGeneraldenominator as nGeneraldenominator, Fosauda.Dtoftran as dBuydate, Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') or Fosauda.Optiontype != 'PO' Then Fosauda.Buysell else Case When Fosauda.Buysell = 'B' Then 'S' Else 'B' End end as cBuysell, Sum(Fosauda.quantity) as nBuyquantity, Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') Then Case When Sum(Fosauda.nValuebrokerage) = 0 then Avg(Fosauda.Final_Rat1) else Case When Fosauda.BuySell = 'B' Then Round(((Sum(Fosauda.Quantity) * Avg(Fosauda.Final_Rat1)) + Sum(Fosauda.nValuebrokerage)) / Sum(Fosauda.Quantity), 10) Else Round(((Sum(Fosauda.Quantity) * Avg(Fosauda.Final_Rat1)) - Sum(Fosauda.nValuebrokerage)) / Sum(Fosauda.Quantity), 10) End End Else Case When Fosauda.Buysell = 'B' Then Avg(Fosauda.Final_rat1) - Avg(Fosauda.Strikeprice) else Avg(Fosauda.Strikeprice) - Avg(Fosauda.Final_rat1) End End as nBuynetrate, Sum(Sum(Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') or Fosauda.Optiontype != 'PO' Then Decode(Fosauda.Buysell, 'B', Fosauda.Quantity, Fosauda.Quantity * -1) Else Decode(Fosauda.Buysell, 'S', Fosauda.Quantity, Fosauda.Quantity * -1) End)) Over(Partition By Fosauda.Oowncode, Company.Fibsacct, Fosauda.Strikeprice, Fosauda.Optiontype Order By Fosauda.Dtoftran, Fosauda.Final_Rat1 rows between current row and unbounded following) as nRunningqty, Sum(Sum(Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') or Fosauda.optiontype != 'PO' Then Decode(Fosauda.Buysell, 'B', Fosauda.Quantity, 0) Else Decode(Fosauda.Buysell, 'S', Fosauda.Quantity, 0) End)) Over(Partition By Fosauda.Oowncode, Company.Fibsacct, Fosauda.Strikeprice, Fosauda.Optiontype Order By Fosauda.Dtoftran, Fosauda.Final_Rat1 rows between current row and unbounded following) as nRunningbuytotal, Sum(Sum(Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') or Fosauda.Optiontype != 'PO' Then Decode(Fosauda.Buysell, 'S', Fosauda.Quantity, 0) Else Decode(Fosauda.Buysell, 'B', Fosauda.Quantity, 0) End)) Over(Partition By Fosauda.Oowncode, Company.Fibsacct, Fosauda.Strikeprice, Fosauda.Optiontype Order By Fosauda.Dtoftran, Fosauda.Final_Rat1 rows between current row and unbounded following) as nRunningselltotal, Sum(Sum(Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') or Fosauda.optiontype != 'PO' Then Decode(Fosauda.Buysell, 'B', Fosauda.Quantity, 0) Else Decode(Fosauda.Buysell, 'S', Fosauda.Quantity, 0) End)) Over(Partition By Fosauda.Oowncode, Company.Fibsacct, Fosauda.Strikeprice, Fosauda.Optiontype) as nSummarybuy, Sum(Sum(Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') or Fosauda.optiontype != 'PO' Then Decode(Fosauda.Buysell, 'S', Fosauda.Quantity, 0) Else Decode(Fosauda.Buysell, 'B', Fosauda.Quantity, 0) End)) Over(Partition By Fosauda.Oowncode, Company.Fibsacct, Fosauda.Strikeprice, Fosauda.Optiontype) as nSummarysell, Sum(Sum(Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') or Fosauda.Optiontype != 'PO' Then Decode(Fosauda.Buysell, 'B', Fosauda.Quantity, 0) Else Decode(Fosauda.Buysell, 'S', Fosauda.Quantity, 0) End) * Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') Then Case When Sum(Fosauda.nValuebrokerage) = 0 then Avg(Fosauda.Final_Rat1) else Case When Fosauda.BuySell = 'B' Then Round(((Sum(Fosauda.Quantity) * Avg(Fosauda.Final_Rat1)) + Sum(Fosauda.nValuebrokerage)) / Sum(Fosauda.Quantity), 10) Else Round(((Sum(Fosauda.Quantity) * Avg(Fosauda.Final_Rat1)) - Sum(Fosauda.nValuebrokerage)) / Sum(Fosauda.Quantity), 10) End End Else Abs(Avg(Fosauda.Final_Rat1) - Avg(fosauda.strikeprice)) End) Over(Partition By Fosauda.Oowncode, Company.Fibsacct, Fosauda.Strikeprice, Fosauda.Optiontype) as nSumBuyamount, Sum(Sum(Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') or Fosauda.Optiontype != 'PO' Then Decode(Fosauda.Buysell, 'S', Fosauda.Quantity, 0) Else Decode(Fosauda.Buysell, 'B', Fosauda.Quantity, 0) End) * Case When (Fosauda.saudatype != 'AS' and Fosauda.Saudatype != 'EX') Then Case When Sum(Fosauda.nValuebrokerage) = 0 then Avg(Fosauda.Final_Rat1) else Case When Fosauda.BuySell = 'B' Then Round(((Sum(Fosauda.Quantity) * Avg(Fosauda.Final_Rat1)) + Sum(Fosauda.nValuebrokerage)) / Sum(Fosauda.Quantity), 10) Else Round(((Sum(Fosauda.Quantity) * Avg(Fosauda.Final_Rat1)) - Sum(Fosauda.nValuebrokerage)) / Sum(Fosauda.Quantity), 10) End End Else Abs(Avg(Fosauda.Final_Rat1) - Avg(fosauda.strikeprice)) End) Over(Partition By Fosauda.Oowncode, Company.Fibsacct, Fosauda.Strikeprice, Fosauda.Optiontype) as nSumSellamount, Sum(Sum(Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') or Fosauda.optiontype != 'PO' Then Decode(Fosauda.Buysell, 'B', Fosauda.Quantity, Fosauda.Quantity * -1) Else Decode(Fosauda.Buysell, 'S', Fosauda.Quantity, Fosauda.Quantity * -1) End)) Over(Partition By Fosauda.Oowncode, Company.Fibsacct, Fosauda.Strikeprice, Fosauda.Optiontype) As nNetquantity From Fosauda Fosauda Inner Join Company Company On Fosauda.firmnumber = Company.Firmnumber and Fosauda.Compcode = Company.oowncode Inner Join Exchange Exchange On Fosauda.Firmnumber = Exchange.Firmnumber and Fosauda.Exchcode = Exchange.Code Where Fosauda.Firmnumber = 'NBS-000001' and Fosauda.Egroup != 'YF' and Fosauda.Egroup != 'LB' and Fosauda.Egroup != 'SR' and Fosauda.Egroup != 'LA' and Fosauda.Sterminal != '99999' and (Fosauda.Oowncode='BO910') and Fosauda.Brcode='143' and Fosauda.Dtoftran>=to_date('01/04/2023','dd/mm/yyyy') and Fosauda.Dtoftran<=to_date('31/03/2024','dd/mm/yyyy') and ((Fosauda.Saudatype != 'B/' and Fosauda.Orignalno = 0) or (Fosauda.Saudatype = 'B/' and (Fosauda.Orignalno = -99 or Fosauda.Dtoftran=to_date('01/04/2023','dd/mm/yyyy')))) group by Fosauda.Oowncode, Company.Fibsacct, Company.Expirydate, Exchange.Operation, Company.Instrutyp, Company.nBaseunit, Company.cUnitofmeasurement, Company.cUnitofTrading, Company.nTradeablelot, Company.nPricenumerator, Company.nPricedenominator, Company.nGeneralnumerator, Company.nGeneraldenominator, Fosauda.Dtoftran, Fosauda.Final_Rat1, Fosauda.buysell, Fosauda.Compcode, Fosauda.Strikeprice, Fosauda.Saudatype, Fosauda.Optiontype), tblFocost as (Select tblFointernal.cClientcode as cClientcode, tblFointernal.cScripcode as cScripcode, tblFointernal.nStrikeprice as nStrikeprice, tblFointernal.cOptiontype as cOptiontype, tblFointernal.cScripname as cScripname, tblFointernal.cOperation as cOperation, tblFoInternal.cInstrutyp as cInstrutyp, tblFoInternal.nBaseunit as nBaseunit, tblFoInternal.cUnitofmeasurement as cUnitofmeasurement, tblFoInternal.cUnitofTrading as cUnitofTrading, tblFoInternal.nTradeablelot as nTradeablelot, tblFoInternal.nPricenumerator as nPricenumerator, tblFoInternal.nPricedenominator as nPricedenominator, tblFoInternal.nGeneralnumerator as nGeneralnumerator, tblFoInternal.nGeneraldenominator as nGeneraldenominator, tblFointernal.dExpirydate as dExpirydate, tblFointernal.dBuydate as dBuydate, tblFointernal.nBuynetrate as nBuynetrate, Case When tblFointernal.nNetquantity = 0 Then 0 When tblFointernal.nNetquantity > 0 Then Case When tblFointernal.nRunningbuytotal > tblFointernal.nNetquantity Then tblFointernal.nNetquantity + tblFointernal.nBuyquantity - tblFointernal.nRunningbuytotal Else tblFointernal.nBuyquantity End When tblFointernal.nNetquantity < 0 Then Case When abs(tblFointernal.nRunningselltotal) > abs(tblFointernal.nNetquantity) Then tblFointernal.nNetquantity - tblFointernal.nBuyquantity + tblFointernal.nRunningselltotal Else tblFointernal.nBuyquantity * -1 End End AS nStockquantity, tblFointernal.nSummarybuy as nSummarybuy, tblFointernal.nSumBuyamount as nSumbuyamount, tblFointernal.nSummarysell as nSummarysell, tblFointernal.nSumSellamount as nSumsellamount From tblFointernal tblFoInternal Where (tblFointernal.nNetquantity > 0 and tblFointernal.cBuysell = 'B' and tblFointernal.nRunningbuytotal <= tblFointernal.nNetquantity + tblFointernal.nBuyquantity) or (tblFointernal.nNetquantity < 0 and tblFointernal.cBuysell = 'S' and abs(tblFointernal.nRunningselltotal) <= Abs(tblFointernal.nNetquantity) + tblFointernal.nBuyquantity) or (tblFointernal.nNetquantity = 0 And tblFointernal.nRunningselltotal = tblFointernal.nSummarysell and tblFointernal.nRunningbuytotal = tblFointernal.nSummarybuy)), tblFinalcost as (Select tblFocost.cClientcode as cClientcode, tblFocost.cScripcode as cScripcode, tblFocost.nStrikeprice as nStrikeprice, tblFocost.cOptiontype as cOptiontype, tblFocost.dExpirydate as dExpirydate, tblFocost.cScripname as cScripname, tblFocost.cOperation as cOperation, tblFocost.cInstrutyp as cInstrutyp, tblFocost.nBaseunit as nBaseunit, tblFocost.cUnitofmeasurement as cUnitofmeasurement, tblFocost.cUnitofTrading as cUnitofTrading, tblFocost.nTradeablelot as nTradeablelot, tblFocost.nPricenumerator as nPricenumerator, tblFocost.nPricedenominator as nPricedenominator, tblFocost.nGeneralnumerator as nGeneralnumerator, tblFocost.nGeneraldenominator as nGeneraldenominator, tblFocost.nSummarybuy - (Case When Sum(tblFocost.nStockquantity) > 0 then Sum(tblFocost.nStockquantity) else 0 end) As nPurchqty, tblFocost.nSumbuyamount - (Case When Sum(tblFocost.nStockquantity) > 0 then Sum(tblFocost.nStockquantity * tblFocost.nBuyNetRate) else 0 end) As nPurchvalue, tblFocost.nSummarysell - (Case When Sum(tblFocost.nStockquantity) < 0 then Sum(Abs(tblFocost.nStockquantity)) else 0 end) as nSalesqty, tblFocost.nSumSellamount - (Case When Sum(tblFocost.nStockquantity) < 0 then Sum(Abs(tblFocost.nStockquantity) * tblFocost.nBuyNetRate) else 0 end) as nSalesvalue, Sum(tblFocost.nStockquantity) As nOsstock, Case When Sum(tblFocost.nStockquantity) != 0 then Round(Sum(tblFocost.nStockquantity * tblFocost.nBuyNetRate) / Sum(tblFocost.nStockquantity), 4) else 0 end as nOsstockavg, Sum(tblFocost.nStockquantity * tblFocost.nBuyNetRate) as nOsstockvalue, tblFocost.nSumSellamount + Sum(tblFocost.nStockquantity * tblFocost.nBuyNetRate) - tblFocost.nSumBuyamount as nProfitLoss, Max(Market.Market) as nMarketrate, Max(Market.Market) * Sum(tblFocost.nStockquantity) as nMarketvalue, ((tblFocost.nSumSellamount + Sum(tblFocost.nStockquantity * tblFocost.nBuyNetRate) - tblFocost.nSumBuyamount)) + ((Max(Market.Market) * Sum(tblFocost.nStockquantity)) - (Sum(tblFocost.nStockquantity * tblFocost.nBuyNetRate))) as nOverallprlo, Max(Market.nPrvcloseprice) as nPrvcloseprice, Max(Market.nHighprice) as nHighprice, Max(Market.nLowprice) as nLowprice, Max(Market.nLowercircuitLimit) as nLowercircuitlimit, Max(Market.nOpenprice) as nOpenprice, Max(Market.nUppercircuitlimit) as nUppercircuitlimit, Max(Market.nNoofTrades) as nNooftrades, Max(Market.nVoltradedToday) as nVoltradedtoday, Max(Market.nVolquantity) as nVolquantity, Max(Market.dLastupdatedate) as dlastupdatedate, Max(Market.n52Weeklow) as n52Weeklow, Max(Market.n52WeekHigh) as n52Weekhigh From tblFocost tblFocost Left Outer Join Market Market On Market.Firmnumber = 'NBS-000001' and tblFocost.cScripcode = Market.Code and tblFocost.nStrikeprice = Market.Strikeprice and tblFocost.cOptiontype = Market.Optiontype and ((Market.nOptmethod = 0 and tblFocost.nStrikeprice = 0) or (Market.nOptmethod = 1 and tblFocost.nStrikeprice != 0)) Group By tblFocost.cClientcode, tblFocost.cScripcode, tblFocost.cScripname, tblFocost.cOperation, tblFocost.cInstrutyp, tblFocost.nBaseunit, tblFocost.cUnitofmeasurement, tblFocost.cUnitofTrading, tblFocost.nTradeablelot, tblFocost.nPricenumerator, tblFocost.nPricedenominator, tblFocost.nGeneralnumerator, tblFocost.nGeneraldenominator, tblFocost.dExpirydate, tblFocost.nStrikeprice, tblFocost.cOptiontype, tblFocost.nSummarybuy, tblFocost.nSumBuyamount, tblFocost.nSummarysell, tblFocost.nSumSellamount), tblPortderfinal as (Select tblFinalcost.cClientcode as cClientcode, tblFinalcost.cScripcode as cScripcode, tblFinalcost.cScripname as cScripname, tblFinalcost.cOperation as cOperation, tblFinalcost.cInstrutyp as cInstrutyp, tblFinalcost.nBaseunit as nBaseunit, tblFinalcost.cUnitofmeasurement as cUnitofmeasurement, tblFinalcost.cUnitofTrading as cUnitofTrading, tblFinalcost.nTradeablelot as nTradeablelot, tblFinalcost.nPricenumerator as nPricenumerator, tblFinalcost.nPricedenominator as nPricedenominator, tblFinalcost.nGeneralnumerator as nGeneralnumerator, tblFinalcost.nGeneraldenominator as nGeneraldenominator, tblFinalcost.nStrikeprice as nStrikeprice, tblFinalcost.cOptiontype as cOptiontype, tblFinalcost.dExpirydate as dExpirydate, tblFinalcost.nPurchqty As nPurchqty, tblFinalcost.nPurchvalue As nPurchvalue, Round(Case When tblFinalcost.nPurchqty != 0 then tblFinalcost.nPurchvalue / tblFinalcost.nPurchqty else 0 End, 4) As nPurchavg, tblFinalcost.nSalesqty as nSalesqty, tblFinalcost.nSalesvalue as nSalesvalue, Round(Case When tblFinalcost.nSalesqty != 0 then tblFinalcost.nSalesvalue / tblFinalcost.nSalesqty else 0 end, 4) as nSalesavg, tblFinalcost.nOsstock As nOsstock, tblFinalcost.nOsstockavg as nOsstockavg, tblFinalcost.nOsstockvalue as nOsstockvalue, tblFinalcost.nMarketrate as nMarketrate, tblFinalcost.nMarketvalue as nMarketvalue, ((tblFinalcost.nMarketrate * tblFinalcost.nOsstock) - (tblFinalcost.nOsstock * tblFinalcost.nOsstockavg)) as nUnrealprlo, tblFinalcost.nProfitloss as nProfitLoss, tblFinalcost.nOverallprlo as nOverallprlo, tblFinalcost.nPrvcloseprice as nPrvcloseprice, tblFinalcost.nHighprice as nHighprice, tblFinalcost.nLowprice as nLowprice, tblFinalcost.nLowercircuitLimit as nLowercircuitlimit, tblFinalcost.nOpenprice as nOpenprice, tblFinalcost.nUppercircuitlimit as nUppercircuitlimit, tblFinalcost.nNooftrades as nNooftrades, tblFinalcost.nVoltradedtoday as nVoltradedtoday, tblFinalcost.nVolquantity as nVolquantity, tblFinalcost.dLastupdatedate as dlastupdatedate, tblFinalcost.n52WeekLow as n52Weeklow, tblFinalcost.n52Weekhigh as n52Weekhigh From tblFinalcost tblFinalcost Order by tblFinalcost.cClientcode, tblFinalcost.cScripname, tblFinalcost.nStrikeprice, tblFinalcost.cOptiontype, tblFinalcost.dExpirydate ), tblPortderfin as (Select tblPortderfinal.cClientcode as cClientcode, '05' as cRowindicator, Sum(tblPortderfinal.nProfitloss) as nFiramount, 0 as nSecamount From tblPortderfinal tblPortderfinal group by tblPortderfinal.cClientcode Union All Select tblPortderfinal.cClientcode as cClientcode, '09' as cRowindicator, Sum(tblPortderfinal.nUnrealprlo) as nFiramount, 0 as nSecamount From tblPortderfinal tblPortderfinal group by tblPortderfinal.cClientcode), tblCashplusderfinal as (Select Coalesce(tblPortcashfin.cClientcode,tblPortderfin.cClientcode) as cClientcode, Case When Coalesce(tblPortcashfin.cRowindicator,tblPortderfin.cRowindicator)='04' or Coalesce(tblPortcashfin.cRowindicator,tblPortderfin.cRowindicator)='05' then '06' else '10' end as cRowindicator, 0 as nFiramount, Sum(Coalesce(tblPortcashfin.nFiramount,tblPortderfin.nFiramount,0)) as nSecamount From tblPortcashfin Full outer join tblPortderfin On tblPortcashfin.cClientcode=tblPortderfin.cClientcode and tblPortcashfin.cRowindicator=tblPortderfin.cRowindicator Where tblPortcashfin.cRowindicator='04' or tblPortcashfin.cRowindicator='08' or tblPortderfin.cRowindicator='05' or tblPortderfin.cRowindicator='09' group by Coalesce(tblPortcashfin.cClientcode,tblPortderfin.cClientcode) , Case When Coalesce(tblPortcashfin.cRowindicator,tblPortderfin.cRowindicator)='04' or Coalesce(tblPortcashfin.cRowindicator,tblPortderfin.cRowindicator)='05' then '06' else '10' end ), tblDividend as (Select Ledger.Oowncode as cClientcode, '11' as cRowindicator, 0 as nFiramount, Sum(Ledger.damount-Ledger.Camount)*-1 as nSecamount From Ledger Ledger Inner Join Journal On Ledger.Firmnumber=Journal.Firmnumber and Ledger.Voucher=Journal.Jvnumber and Ledger.nFinancialyear=Journal.nFinancialyear Where Ledger.Firmnumber='NBS-000001' and Ledger.nFinancialyear=2024 and (Ledger.Oowncode='BO910') and Ledger.Branchcode='143' and Ledger.Dtoftran>=to_date('01/04/2023','dd/mm/yyyy') and Ledger.Dtoftran<=to_date('31/03/2024','dd/mm/yyyy') and Journal.nEntrytype=1 group by Ledger.Oowncode ), tblDirectDividend as (Select tblDirectdiv.cClientcode as cClientcode, '16' as cRowindicator, 0 as nFiramount, Sum(tblDirectdiv.nQuantity*tblDirectdiv.nRate)*-1 as nSecamount From tblDirectdiv tblDirectdiv Inner Join Ldfibs Ldfibs On tblDirectdiv.cFirmnumber = Ldfibs.Firmnumber and tblDirectdiv.cClientcode = Ldfibs.Oowncode Where tblDirectdiv.cFirmnumber='NBS-000001' and (tblDirectdiv.cClientcode='BO910') and tblDirectdiv.dDtoftran>=to_date('01/04/2023','dd/mm/yyyy') and tblDirectdiv.dDtoftran<=to_date('31/03/2024','dd/mm/yyyy') group by tblDirectdiv.cClientcode ), tbltmpBillcharges as (Select Billcharges.Oowncode as cClientcode, Case When Billcharges.Egroup='FU' then '14' else '13' end as cRowindicator, Sum(Billcharges.Quantity*Billcharges.Final_Rat1) as nFiramount, 0 as nSecamount From Billcharges Billcharges Where Billcharges.Firmnumber='NBS-000001' and Billcharges.Brcode='143' and (Billcharges.Oowncode='BO910') and Billcharges.Dtoftran>=to_date('01/04/2023','dd/mm/yyyy') and Billcharges.Dtoftran<=to_date('31/03/2024','dd/mm/yyyy') group by Billcharges.Oowncode, Case When Billcharges.Egroup='FU' then '14' else '13' end ), tbltmpbillchgtotal as (Select tbltmpBillcharges.cClientcode as cClientcode, '12' as cRowindicator, 0 as nFiramount, Sum(tbltmpBillcharges.nFiramount) as nSecamount from tbltmpBillcharges tbltmpBillcharges group by tbltmpbillcharges.cClientcode ), tblMiscentries as ( Select Ledger.Oowncode as cClientcode, '15' as cRowindicator, 0 as nFiramount, Sum(Ledger.damount-Ledger.Camount)*-1 as nSecamount From Ledger Ledger Inner Join Journal On Ledger.Firmnumber=Journal.Firmnumber and Ledger.Voucher=Journal.Jvnumber and Ledger.nFinancialyear=Journal.nFinancialyear Where Ledger.Firmnumber='NBS-000001' and Ledger.nFinancialyear=2024 and (Ledger.Oowncode='BO910') and Ledger.Branchcode='143' and Ledger.Dtoftran>=to_date('01/04/2023','dd/mm/yyyy') and Ledger.Dtoftran<=to_date('31/03/2024','dd/mm/yyyy') and Journal.nEntrytype!=1 group by Ledger.Oowncode ), tbltempportalloc as (Select Coalesce(tblFinledger.cClientcode,tblPortcashfin.cClientcode) as cClientcode, '27' as cRowindicator, Sum(Nvl(tblFinledger.nFiramount,0)+Nvl(tblPortcashfin.nFiramount,0)) as nFiramount, 0 as nSecamount From tblFinledger tblFinledger Full Outer Join tblPortcashfin On tblFinledger.cClientcode=tblPortcashfin.cClientcode and tblFinledger.cRowindicator=tblPortcashfin.cRowindicator Where (tblFinledger.cRowindicator='26' or tblPortcashfin.cRowindicator='25') group by Coalesce(tblFinledger.cClientcode,tblPortcashfin.cClientcode) ), tbltemptotdays as (Select '18' as cRowindicator, (to_date('31/03/2024','dd/mm/yyyy') - to_date('01/04/2024','dd/mm/yyyy'))+1 as nSecamount From dual ), tblFinalloop as (Select tblReportdesc.cRowindicator as cRowindicator, tblReportdesc.cRowdesc as cRowdesc, Coalesce(tblReportdesc.cClientcode,tblOpenstk.cClientcode,tblCapinout.cClientcode,tblPortcashfin.cClientcode,tblPortderfin.cClientcode,tblCashplusderfinal.cClientcode,tblDividend.cClientcode,tbltmpbillcharges.cClientcode,tbltmpbillchgtotal.cClientcode,tblMiscentries.cClientcode,tblFinledger.cClientcode,tbltempPortalloc.cClientcode,tblDirectdividend.cClientcode) as cClientcode, Coalesce(tblOpenstk.nFiramount,tblCapinout.nFiramount,tblPortcashfin.nFiramount,tblPortderfin.nFiramount,tblCashplusderfinal.nFiramount,tblDividend.nFiramount,tbltmpBillcharges.nFiramount,tbltmpbillchgtotal.nFiramount,tblMiscentries.nFiramount,tblFinledger.nFiramount,tbltempPortalloc.nFiramount,tblDirectdividend.nFiramount) as nFiramount, Coalesce(tblOpenstk.nSecamount,tblCapinout.nSecamount,tblPortcashfin.nSecamount,tblPortderfin.nSecamount,tblCashplusderfinal.nSecamount,tblDividend.nSecamount,tbltmpBillcharges.nSecamount,tbltmpBillchgtotal.nSecamount,tblMiscentries.nSecamount,tblFinledger.nSecamount,tbltempPortalloc.nSecamount,tbltempTotdays.nSecamount,tbltempTotdays.nSecamount) as nSecamount From tblReportdesc tblReportdesc Left Outer Join tblOpenstk On tblReportdesc.cRowindicator=tblOpenstk.cRowindicator and tblReportdesc.cClientcode=tblOpenstk.cClientcode Left Outer Join tblCapinout On tblReportdesc.cRowindicator=tblCapinout.cRowindicator and tblReportdesc.cClientcode=tblCapinout.cClientcode Left Outer Join tblPortcashfin On tblReportdesc.cRowindicator=tblPortcashfin.cRowindicator and tblReportdesc.cClientcode=tblPortcashfin.cClientcode Left Outer Join tblPortderfin On tblReportdesc.cRowindicator=tblPortderfin.cRowindicator and tblReportdesc.cClientcode=tblPortderfin.cClientcode Left Outer Join tblCashplusderfinal On tblReportdesc.cRowindicator=tblCashplusderfinal.cRowindicator and tblReportdesc.cClientcode=tblCashplusderfinal.cClientcode Left Outer Join tblDividend On tblReportdesc.cRowindicator=tblDividend.cRowindicator and tblReportdesc.cClientcode=tblDividend.cClientcode Left Outer Join tbltmpBillcharges On tblReportdesc.cRowindicator=tbltmpBillcharges.cRowindicator and tblReportdesc.cClientcode=tbltmpBillcharges.cClientcode Left Outer Join tbltmpbillchgtotal On tblReportdesc.cRowindicator=tbltmpBillchgtotal.cRowindicator and tblReportdesc.cClientcode=tbltmpBillchgtotal.cClientcode Left Outer Join tblMiscentries On tblReportdesc.cRowindicator=tblMiscentries.cRowindicator and tblReportdesc.cClientcode=tblMiscentries.cClientcode Left Outer Join tblFinledger On tblReportdesc.cRowindicator=tblFinledger.cRowindicator and tblReportdesc.cClientcode=tblFinledger.cClientcode Left Outer Join tbltempPortalloc On tblReportdesc.cRowindicator=tbltempPortalloc.cRowindicator and tblReportdesc.cClientcode=tbltempPortalloc.cClientcode Left Outer Join tblDirectdividend On tblReportdesc.cRowindicator=tblDirectdividend.cRowindicator and tblReportdesc.cClientcode=tblDirectdividend.cClientcode Left Outer Join tbltemptotdays On tblReportdesc.cRowindicator=tbltempTotdays.cRowindicator ), tbltempporttotal as ( Select '17' as cRowindicator, tblFinalloop.cClientcode as cClientcode, Sum(tblFinalloop.nSecamount) as nTotalamount From tblFinalloop Where tblFinalloop.cRowindicator!='18' and nvl(trim(tblFinalloop.cClientcode),' ')!=' ' group by tblFinalloop.cClientcode ), tbltemptotalcapital as ( Select tblFinalloop.cClientcode as cClientcode, Sum(tblFinalloop.nSecamount) as nTotalamount From tblFinalloop tblFinalloop Where (tblFinalloop.cRowindicator='02' or tblFinalloop.cRowindicator='01') and nvl(trim(tblFinalloop.cClientcode),' ')!=' ' group by tblFinalloop.cClientcode ) Select tblFinalloop.cRowindicator as cRowindicator, tblFinalloop.cRowdesc as cRowdesc, tblFinalloop.cClientcode as cClientcode, tblFinalloop.nFiramount as nFiramount, Case When (tblFinalloop.cRowindicator=25 or tblFinalloop.cRowindicator=26) and tbltempPortalloc.nFiramount!=0 then Round(tblFinalloop.nFiramount/tbltempPortalloc.nFiramount*100,2) When tblFInalloop.cRowindicator='17' then tbltempporttotal.nTotalamount When tblFinalloop.cRowindicator='19' and tbltemptotalcapital.nTotalamount!=0 then Round((tbltempporttotal.nTotalamount-tbltemptotalcapital.nTotalamount)*100/tbltemptotalcapital.nTotalamount,2) When tblFinalloop.cRowindicator='20' and tbltemptotalcapital.nTotalamount!=0 then Round(((tbltempporttotal.nTotalamount-tbltemptotalcapital.nTotalamount)*100/tbltemptotalcapital.nTotalamount)*365/ ((to_date('31/03/2024','dd/mm/yyyy') - to_date('01/04/2024','dd/mm/yyyy')+1)),2) else tblFinalloop.nSecamount end as nSecamount From tblFinalloop Left Outer Join tbltempportalloc On tblFinalloop.cClientcode=tbltempportalloc.cClientcode Left Outer Join tbltempporttotal On tblFinalloop.cClientcode=tbltempporttotal.cClientcode Left Outer Join tbltemptotalcapital On tblFinalloop.cClientcode=tbltemptotalcapital.cClientcode Order by 1 Title : 01~Error Description : ORA-01476: divisor is equal to zero Method : getglobalportfolioLine : 44015 Message : getGlobalportfolio StackTrace : at OracleInternal.ServiceObjects.OracleConnectionImpl.VerifyExecution(Int32& cursorId, Boolean bThrowArrayBindRelatedErrors, SqlStatementType sqlStatementType, Int32 arrayBindCount, OracleException& exceptionForArrayBindDML, Boolean& hasMoreRowsInDB, Boolean bFirstIterationDone) at OracleInternal.ServiceObjects.OracleCommandImpl.ExecuteReader(String commandText, OracleParameterCollection paramColl, CommandType commandType, OracleConnectionImpl connectionImpl, OracleDataReaderImpl& rdrImpl, Int32 longFetchSize, Int64 clientInitialLOBFS, OracleDependencyImpl orclDependencyImpl, Int64[] scnForExecution, Int64[]& scnFromExecution, OracleParameterCollection& bindByPositionParamColl, Boolean& bBindParamPresent, Int64& internalInitialLOBFS, OracleException& exceptionForArrayBindDML, OracleConnection connection, OracleLogicalTransaction& oracleLogicalTransaction, IEnumerable`1 adrianParsedStmt, Boolean isDescribeOnly, Boolean isFromEF) at Oracle.ManagedDataAccess.Client.OracleCommand.ExecuteReader(Boolean requery, Boolean fillRequest, CommandBehavior behavior) at Oracle.ManagedDataAccess.Client.OracleDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable) at clientlevel.Thinclientlevel.Clientlogin.getglobalportfolio(DateTime tdStartdate, DateTime tdEnddate, DateTime tdPoadate, DateTime tdFinancialstartdate, Int32 tnAngleselection, String tcClientfilter, Cliole loLdcommon) in File25:line 44015 Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 438456320 Shut down : N Username : MOBBO Date/Time : 18/05/2024 12:33:02 PM Connection : Closed =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : BO910 With tbltempReport as (Select '01' as cRowindicator, 'Opening Market Value' as cRowdesc From Dual Union All Select '02' as cRowindicator, 'Capital In(+)/Out(-)' as cRowdesc From Dual Union All Select '03' as cRowindicator, Rpad(' ',8)||'Realized Profit (+)/(-)' as cRowdesc From dual Union All Select '04' as cRowindicator, 'Cash Segment' as cRowdesc From dual Union All Select '05' as cRowindicator, 'Derivatives Segment' as cRowdesc From dual Union All Select '06' as cRowindicator, 'Total Realized Profit(+)/(-) ' as cRowdesc From dual Union All Select '07' as cRowindicator, Rpad(' ',8)||'Un-Realized Profit (+)/(-) ' as cRowdesc From dual Union All Select '08' as cRowindicator, 'Cash Segment' as cRowdesc From dual Union All Select '09' as cRowindicator, 'Derivatives Segment' as cRowdesc From dual Union All Select '10' as cRowindicator, 'Total Un-Realized Profit(+)/(-) ' as cRowdesc From dual Union All Select '11' as cRowindicator, 'Total Dividend Amount' as cRowdesc From dual Union All Select '12' as cRowindicator, Rpad(' ',8)||'Statutory Charges' as cRowdesc From dual Union All Select '13' as cRowindicator, 'Cash Segment' as cRowdesc From dual Union All Select '14' as cRowindicator, 'Derivatives Segment' as cRowdesc From dual Union All Select '15' as cRowindicator, 'Misc. JV Entries' as cRowdesc From dual Union All Select '16' as cRowindicator, 'Direct Dividend Credit' as cRowdesc From dual Union All Select '17' as cRowindicator, 'Total Portfolio Allocation' as cRowdesc From dual Union All Select '18' as cRowindicator, 'Total No. of Days' as cRowdesc From dual Union All Select '19' as cRowindicator, 'Absolute Return' as cRowdesc From dual Union All Select '20' as cRowindicator, 'Annualized Return' as cRowdesc From dual Union All Select '24' as cRowindicator, Rpad(' ',8)||'Portfolio Allocation' as cRowdesc From dual Union All Select '25' as cRowindicator, 'Equity' as cRowdesc From dual Union All Select '26' as cRowindicator, 'Cash and Equivalent' as cRowdesc From dual Union All Select '27' as cRowindicator, 'Total Portfolio Allocation' as cRowdesc From dual ), tblReportdesc as (Select Ldfibs.Oowncode as cClientcode, tbltempReport.* From Ldfibs Ldfibs Left Outer Join tbltempReport On 1=1 Where Ldfibs.Firmnumber='NBS-000001' and (Ldfibs.Oowncode='BO910') and Ldfibs.Brcode='143' ), tblOpendet as (Select Ledger.Oowncode as cClientcode, '01' as cRowindicator, Sum(Ledger.Damount-Ledger.Camount)*-1 as nSecamount From Ledger Ledger Where Ledger.Firmnumber='NBS-000001' and Ledger.nFinancialyear=2024 and (Ledger.Oowncode='BO910') and Ledger.Branchcode='143' and Substr(Ledger.Voucher,1,4)='OPNG' group by Ledger.Oowncode Union All Select Sauda.Oowncode as cClientcode, '01' as cRowindicator, Sum(Sauda.Quantity*Sauda.Market) as nSecamount From Sauda Sauda Where Sauda.Egroup='OK' and Sauda.Firmnumber = 'NBS-000001' and (Sauda.Oowncode='BO910') and Sauda.Brcode='143' group by Sauda.Oowncode ), tblOpenstk as (Select tblOpendet.cClientcode as cClientcode, Max(tblOpendet.cRowindicator) as cRowindicator, 0 as nFiramount, Sum(tblOpendet.nSecamount) as nSecamount From tblOpendet tblOpendet group by tblOpendet.cClientcode), tblCapinout as (Select Ledger.Oowncode as cClientcode, '02' as cRowindicator, 0 as nFiramount, Sum(Ledger.Damount-Ledger.Camount)*-1 as nSecamount From Ledger Ledger Where Ledger.Firmnumber='NBS-000001' and Ledger.nFinancialyear=2024 and (Ledger.Oowncode='BO910') and Ledger.Branchcode='143' and Ledger.Dtoftran>=to_date('01/04/2023','dd/mm/yyyy') and Ledger.Dtoftran<=to_date('31/03/2024','dd/mm/yyyy') and (Substr(Ledger.Voucher,1,2)='RE' or Substr(Ledger.Voucher,1,2)='PY') group by Ledger.Oowncode ), tblFinledger as (Select Ledger.Oowncode as cClientcode, '26' as cRowindicator, Sum(Ledger.Damount-Ledger.Camount)*-1 as nFiramount, 0 as nSecamount From Ledger Ledger Where Ledger.Firmnumber='NBS-000001' and Ledger.nFinancialyear=2024 and (Ledger.Oowncode='BO910') and Ledger.Branchcode='143' and Ledger.Dtoftran>=to_date('01/04/2023','dd/mm/yyyy') and Ledger.Dtoftran<=to_date('31/03/2024','dd/mm/yyyy') group by Ledger.Oowncode ), tblCashinternal as (Select Sauda.Oowncode as cClientcode, Sauda.Compcode as cScripcode, Sauda.Dtoftran as dBuydate, Sauda.BuySell as cBuysell, Sum(Sauda.Quantity) as nBuyquantity, Case When Sum(Sauda.Brokpercontract) = 0 Then Avg(Sauda.Final_Rat1) Else Case When Sauda.BuySell = 'B' Then Round(((Sum(Sauda.Quantity) * Avg(Sauda.Final_Rat1)) + Sum(Sauda.Brokpercontract)) / Sum(Sauda.Quantity), 10) Else Round(((Sum(Sauda.Quantity) * Avg(Sauda.Final_Rat1)) - Sum(Sauda.Brokpercontract)) / Sum(Sauda.Quantity), 10) End End as nBuynetrate, Sum(Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, Sauda.Quantity * -1))) Over(Partition By Sauda.Oowncode, Sauda.Compcode Order By Sauda.Dtoftran, Sauda.Final_Rat1 rows between current row and unbounded following) as nRunningqty, Sum(Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, 0))) Over(Partition By Sauda.Oowncode, Sauda.Compcode Order By Sauda.Dtoftran, Sauda.Final_Rat1 rows between current row and unbounded following) as nRunningbuytotal, Sum(Sum(Decode(Sauda.Buysell, 'S', Sauda.Quantity, 0))) Over(Partition By Sauda.Oowncode, Sauda.Compcode Order By Sauda.Dtoftran, Sauda.Final_Rat1 rows between current row and unbounded following) as nRunningselltotal, Sum(Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, 0))) Over(Partition By Sauda.Oowncode, Sauda.Compcode) as nSummarybuy, Sum(Sum(Decode(Sauda.Buysell, 'S', Sauda.Quantity, 0))) Over(Partition By Sauda.Oowncode, Sauda.Compcode) as nSummarysell, Sum(Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, 0)) * Case When Sum(Sauda.Brokpercontract) = 0 Then Avg(Sauda.Final_Rat1) Else Case When Sauda.BuySell = 'B' Then Round(((Sum(Sauda.Quantity) * Avg(Sauda.Final_Rat1)) + Sum(Sauda.Brokpercontract)) / Sum(Sauda.Quantity), 10) Else 0 End End) Over(Partition By Sauda.Oowncode, Sauda.Compcode) as nSumBuyamount, Sum(Sum(Decode(Sauda.Buysell, 'S', Sauda.Quantity, 0)) * Case When Sum(Sauda.Brokpercontract) = 0 Then Avg(Sauda.Final_Rat1) Else Case When Sauda.BuySell = 'B' Then 0 Else Round(((Sum(Sauda.Quantity) * Avg(Sauda.Final_Rat1)) - Sum(Sauda.Brokpercontract)) / Sum(Sauda.Quantity), 10) End End) Over(Partition By Sauda.Oowncode, Sauda.Compcode) as nSumSellamount, Sum(Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, Sauda.Quantity * -1))) Over(Partition By Sauda.Oowncode, Sauda.Compcode) As nNetquantity From Sauda Sauda Where Sauda.Firmnumber='NBS-000001' and Sauda.Egroup!='YC' and Sauda.Egroup != 'LB' and Sauda.Egroup != 'SR' and Sauda.Egroup != 'LA' and Sauda.Sterminal != '99999' and Sauda.Dtoftran 0 Then Case When tblCashinternal.nRunningbuytotal > tblCashinternal.nNetquantity Then tblCashinternal.nNetquantity + tblCashinternal.nBuyquantity - tblCashinternal.nRunningbuytotal Else tblCashinternal.nBuyquantity End When tblCashinternal.nNetquantity < 0 Then Case When Abs(tblCashinternal.nRunningselltotal) > Abs(tblCashinternal.nNetquantity) Then tblCashinternal.nNetquantity - tblCashinternal.nBuyquantity + tblCashinternal.nRunningselltotal Else tblCashinternal.nBuyquantity * -1 End End) as nOpStockquantity, Sum((Case When tblCashinternal.nNetquantity = 0 Then 0 When tblCashinternal.nNetquantity > 0 Then Case When tblCashinternal.nRunningbuytotal > tblCashinternal.nNetquantity Then tblCashinternal.nNetquantity + tblCashinternal.nBuyquantity - tblCashinternal.nRunningbuytotal Else tblCashinternal.nBuyquantity End When tblCashinternal.nNetquantity < 0 Then Case When Abs(tblCashinternal.nRunningselltotal) > Abs(tblCashinternal.nNetquantity) Then tblCashinternal.nNetquantity - tblCashinternal.nBuyquantity + tblCashinternal.nRunningselltotal Else tblCashinternal.nBuyquantity * -1 End End) * tblCashinternal.nBuynetrate) as nOpStockAmount from tblCashinternal Where (tblCashinternal.nNetquantity > 0 And tblCashinternal.cBuysell = 'B' And tblCashinternal.nRunningbuytotal <= tblCashinternal.nNetquantity + tblCashinternal.nBuyquantity) or (tblCashinternal.nNetquantity < 0 and tblCashinternal.cBuysell = 'S' and Abs(tblCashinternal.nRunningselltotal) <= Abs(tblCashinternal.nNetquantity) + tblCashinternal.nBuyquantity) Group By tblCashinternal.cClientcode, tblCashinternal.cScripcode), tblCashinternal1 as (Select Sauda.Oowncode as cClientcode, Sauda.Compcode as cScripcode, Sauda.Dtoftran as dBuydate, Sauda.BuySell as cBuysell, Sum(Sauda.Quantity) as nBuyquantity, Case When Sum(Sauda.Brokpercontract) = 0 Then Avg(Sauda.Final_Rat1) Else Case When Sauda.BuySell = 'B' Then Round(((Sum(Sauda.Quantity) * Avg(Sauda.Final_Rat1)) + Sum(Sauda.Brokpercontract)) / Sum(Sauda.Quantity), 10) Else Round(((Sum(Sauda.Quantity) * Avg(Sauda.Final_Rat1)) - Sum(Sauda.Brokpercontract)) / Sum(Sauda.Quantity), 10) End End as nBuynetrate, Sum(Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, Sauda.Quantity * -1))) Over(Partition By Sauda.Oowncode, Sauda.Compcode Order By Sauda.Dtoftran, Sauda.Final_Rat1 rows between current row and unbounded following) as nRunningqty, Sum(Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, 0))) Over(Partition By Sauda.Oowncode, Sauda.Compcode Order By Sauda.Dtoftran, Sauda.Final_Rat1 rows between current row and unbounded following) as nRunningbuytotal, Sum(Sum(Decode(Sauda.Buysell, 'S', Sauda.Quantity, 0))) Over(Partition By Sauda.Oowncode, Sauda.Compcode Order By Sauda.Dtoftran, Sauda.Final_Rat1 rows between current row and unbounded following) as nRunningselltotal, Sum(Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, 0))) Over(Partition By Sauda.Oowncode, Sauda.Compcode) as nSummarybuy, Sum(Sum(Decode(Sauda.Buysell, 'S', Sauda.Quantity, 0))) Over(Partition By Sauda.Oowncode, Sauda.Compcode) as nSummarysell, Sum(Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, 0)) * Case When Sum(Sauda.Brokpercontract) = 0 Then Avg(Sauda.Final_Rat1) Else Case When Sauda.BuySell = 'B' Then Round(((Sum(Sauda.Quantity) * Avg(Sauda.Final_Rat1)) + Sum(Sauda.Brokpercontract)) / Sum(Sauda.Quantity), 10) Else 0 End End) Over(Partition By Sauda.Oowncode, Sauda.Compcode) as nSumBuyamount, Sum(Sum(Decode(Sauda.Buysell, 'S', Sauda.Quantity, 0)) * Case When Sum(Sauda.Brokpercontract) = 0 Then Avg(Sauda.Final_Rat1) Else Case When Sauda.BuySell = 'B' Then 0 Else Round(((Sum(Sauda.Quantity) * Avg(Sauda.Final_Rat1)) - Sum(Sauda.Brokpercontract)) / Sum(Sauda.Quantity), 10) End End) Over(Partition By Sauda.Oowncode, Sauda.Compcode) as nSumSellamount, Sum(Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, Sauda.Quantity * -1))) Over(Partition By Sauda.Oowncode, Sauda.Compcode) As nNetquantity From Sauda Sauda Where Sauda.Firmnumber='NBS-000001' and Sauda.Egroup!='YC' and Sauda.Egroup != 'LB' and Sauda.Egroup != 'SR' and Sauda.Egroup != 'LA' and Sauda.Sterminal != '99999' and Sauda.Dtoftran<=to_date('31/03/2024','dd/mm/yyyy') and Sauda.Brcode='143' and (Sauda.Oowncode='BO910') group by Sauda.Oowncode, Sauda.Dtoftran, Sauda.Final_Rat1, Sauda.buysell, Sauda.Compcode), tblClosing as (Select tblCashinternal1.cClientcode as cClientcode, tblCashinternal1.cScripcode as cScripcode, Sum(Case When tblCashinternal1.nNetquantity = 0 Then 0 When tblCashinternal1.nNetquantity > 0 Then Case When tblCashinternal1.nRunningbuytotal > tblCashinternal1.nNetquantity Then tblCashinternal1.nNetquantity + tblCashinternal1.nBuyquantity - tblCashinternal1.nRunningbuytotal Else tblCashinternal1.nBuyquantity End When tblCashinternal1.nNetquantity < 0 Then Case When Abs(tblCashinternal1.nRunningselltotal) > Abs(tblCashinternal1.nNetquantity) Then tblCashinternal1.nNetquantity - tblCashinternal1.nBuyquantity + tblCashinternal1.nRunningselltotal Else tblCashinternal1.nBuyquantity * -1 End End) AS nCLStockquantity, Sum((Case When tblCashinternal1.nNetquantity = 0 Then 0 When tblCashinternal1.nNetquantity > 0 Then Case When tblCashinternal1.nRunningbuytotal > tblCashinternal1.nNetquantity Then tblCashinternal1.nNetquantity + tblCashinternal1.nBuyquantity - tblCashinternal1.nRunningbuytotal Else tblCashinternal1.nBuyquantity End When tblCashinternal1.nNetquantity < 0 Then Case When Abs(tblCashinternal1.nRunningselltotal) > Abs(tblCashinternal1.nNetquantity) Then tblCashinternal1.nNetquantity - tblCashinternal1.nBuyquantity + tblCashinternal1.nRunningselltotal Else tblCashinternal1.nBuyquantity * -1 End End) * tblCashinternal1.nBuynetrate) as nClStockAmount from tblCashinternal1 Where (tblCashinternal1.nNetquantity > 0 And tblCashinternal1.cBuysell = 'B' And tblCashinternal1.nRunningbuytotal <= tblCashinternal1.nNetquantity + tblCashinternal1.nBuyquantity) or (tblCashinternal1.nNetquantity < 0 and tblCashinternal1.cBuysell = 'S' and Abs(tblCashinternal1.nRunningselltotal) <= Abs(tblCashinternal1.nNetquantity) + tblCashinternal1.nBuyquantity) Group By tblCashinternal1.cClientcode, tblCashinternal1.cScripcode), tblBuYSell as (Select Sauda.Oowncode as cClientcode, Sauda.Compcode as cScripcode, Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity, 0)) as nbuyQty, Sum(Decode(Sauda.Buysell, 'S', Sauda.Quantity, 0)) as nsellQty, Sum(Decode(Sauda.Buysell, 'B', Sauda.Quantity * Sauda.Final_Rat1 , 0)+Case When Sauda.Buysell='B' then Sauda.Brokpercontract else 0 end) as nBuyamount, Sum(Decode(Sauda.Buysell, 'S', Sauda.Quantity * Sauda.Final_Rat1 , 0)-Case When Sauda.Buysell='S' then Sauda.Brokpercontract else 0 end) as nSellamount From Sauda Sauda Where Sauda.Firmnumber='NBS-000001' and Sauda.Egroup!='YC' and Sauda.Egroup != 'LB' and Sauda.Egroup != 'SR' and Sauda.Egroup != 'LA' and Sauda.Sterminal != '99999' and Sauda.Dtoftran>=to_date('01/04/2023','dd/mm/yyyy') and Sauda.Dtoftran<=to_Date('31/03/2024','dd/mm/yyyy') and Sauda.Brcode='143' and (Sauda.Oowncode='BO910') group by Sauda.Oowncode, Sauda.Compcode), tblCashcost as (Select Coalesce(tblOpening.cClientcode,tblClosing.cClientcode,tblBuysell.cClientcode) as cClientcode, Coalesce(tblOpening.cScripcode,tblClosing.cScripcode,tblBuysell.cScripcode) as cScripcode, Nvl(tblOpening.nOpstockquantity,0) as nOpstockquantity, Nvl(tblOpening.nOpstockamount,0) as nOpstockamount, Case When Nvl(tblOpening.nOpstockquantity,0)!=0 then Round(Nvl(tblOpening.nOpstockamount,0)/Nvl(tblOpening.nOpstockquantity,0),4) else 0 end as nOpstockavg, Nvl(tblBuysell.nBuyqty,0) as nPrePurchqty, Nvl(tblBuysell.nBuyamount,0) as nPrePurchvalue, Case When Nvl(tblBuysell.nBuyqty,0) !=0 then Round(Nvl(tblBuysell.nBuyamount,0)/Nvl(tblBuysell.nBuyqty,0),4) else 0 end as nPrePurchavg, Nvl(tblBuysell.nSellQty, 0) as nPreSellqty, Nvl(tblBuysell.nSellamount, 0) as nPreSellvalue, Case When Nvl(tblBuysell.nSellQty, 0) != 0 then Round(Nvl(tblBuysell.nSellamount, 0) / Nvl(tblBuysell.nSellQty, 0), 4) else 0 end as nPreSellavg, Least((Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockquantity, 0) + Nvl(tblBuysell.nBuyqty, 0) Else Nvl(tblBuysell.nBuyqty, 0) End), (Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockquantity, 0)) + Nvl(tblBuysell.nSellqty, 0) Else Nvl(tblBuysell.nSellqty, 0) End)) as nPurchqty, Round((Case When (Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockquantity, 0) + Nvl(tblBuysell.nBuyqty, 0) Else Nvl(tblBuysell.nBuyqty, 0) End) <= (Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockquantity, 0)) + Nvl(tblBuysell.nSellqty, 0) Else Nvl(tblBuysell.nSellqty, 0) End) Then Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockAmount, 0) + Nvl(tblBuysell.nBuyAmount, 0) Else Nvl(tblBuysell.nBuyAmount, 0) End Else Nvl(tblBuysell.nBuyAmount, 0) + Nvl(tblOpening.nOpstockAmount, 0) - nvl(tblClosing.nClStockAmount, 0) End), 2) as nPurchvalue, Round((Case When Least((Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockquantity, 0) + Nvl(tblBuysell.nBuyqty, 0) Else Nvl(tblBuysell.nBuyqty, 0) End), (Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockquantity, 0)) + Nvl(tblBuysell.nSellqty, 0) Else Nvl(tblBuysell.nSellqty, 0) End)) != 0 Then (Case When (Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockquantity, 0) + Nvl(tblBuysell.nBuyqty, 0) Else Nvl(tblBuysell.nBuyqty, 0) End) <= (Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockquantity, 0)) + Nvl(tblBuysell.nSellqty, 0) Else Nvl(tblBuysell.nSellqty, 0) End) Then Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockAmount, 0) + Nvl(tblBuysell.nBuyAmount, 0) Else Nvl(tblBuysell.nBuyAmount, 0) End Else Nvl(tblBuysell.nBuyAmount, 0) + Nvl(tblOpening.nOpstockAmount, 0) - nvl(tblClosing.nClStockAmount, 0) End) / (Least((Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockquantity, 0) + Nvl(tblBuysell.nBuyqty, 0) Else Nvl(tblBuysell.nBuyqty, 0) End), (Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockquantity, 0)) + Nvl(tblBuysell.nSellqty, 0) Else Nvl(tblBuysell.nSellqty, 0) End))) Else 0 End), 4) as nPurchavg, Least((Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockquantity, 0) + Nvl(tblBuysell.nBuyqty, 0) Else Nvl(tblBuysell.nBuyqty, 0) End), (Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockquantity, 0)) + Nvl(tblBuysell.nSellqty, 0) Else Nvl(tblBuysell.nSellqty, 0) End)) as nSalesqty, Round((Case When (Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockquantity, 0) + Nvl(tblBuysell.nBuyqty, 0) Else Nvl(tblBuysell.nBuyqty, 0) End) >= (Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockquantity, 0)) + Nvl(tblBuysell.nSellqty, 0) Else Nvl(tblBuysell.nSellqty, 0) End) Then Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockAmount, 0)) + Nvl(tblBuysell.nSellAmount, 0) Else Nvl(tblBuysell.nSellAmount, 0) End Else Nvl(tblBuysell.nSellAmount, 0) - Nvl(tblOpening.nOpstockAmount, 0) + nvl(tblClosing.nClStockAmount, 0) End), 2) as nSalesvalue, Round((Case When Least((Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockquantity, 0) + Nvl(tblBuysell.nBuyqty, 0) Else Nvl(tblBuysell.nBuyqty, 0) End), (Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockquantity, 0)) + Nvl(tblBuysell.nSellqty, 0) Else Nvl(tblBuysell.nSellqty, 0) End)) != 0 Then (Case When (Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockquantity, 0) + Nvl(tblBuysell.nBuyqty, 0) Else Nvl(tblBuysell.nBuyqty, 0) End) >= (Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockquantity, 0)) + Nvl(tblBuysell.nSellqty, 0) Else Nvl(tblBuysell.nSellqty, 0) End) Then Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockAmount, 0)) + Nvl(tblBuysell.nSellAmount, 0) Else Nvl(tblBuysell.nSellAmount, 0) End Else Nvl(tblBuysell.nSellAmount, 0) - Nvl(tblOpening.nOpstockAmount, 0) + nvl(tblClosing.nClStockAmount, 0) End) / (Least((Case When Nvl(tblOpening.nOpstockquantity, 0) > 0 Then Nvl(tblOpening.nOpstockquantity, 0) + Nvl(tblBuysell.nBuyqty, 0) Else Nvl(tblBuysell.nBuyqty, 0) End), (Case When Nvl(tblOpening.nOpstockquantity, 0) < 0 Then Abs(Nvl(tblOpening.nOpstockquantity, 0)) + Nvl(tblBuysell.nSellqty, 0) Else Nvl(tblBuysell.nSellqty, 0) End))) ELse 0 End), 4) as nSalesavg, Nvl(tblClosing.nClstockquantity, 0) as nOsstock, Nvl(tblClosing.nClstockamount, 0) as nOsstockvalue, Case When Nvl(tblClosing.nClstockquantity, 0) != 0 then Round(Nvl(tblClosing.nClstockamount, 0) / Nvl(tblClosing.nClstockquantity, 0), 4) else 0 end as nOsstockavg, (nvl(tblBuySell.nSellAmount, 0) - nvl(tblOpening.nOpStockAmount, 0) - nvl(tblBuySell.nBuyAmount, 0) + nvl(tblClosing.nClStockAmount, 0)) as nProfitloss, ((Market.Market * nvl(tblClosing.nClstockquantity, 0)) - Nvl(tblClosing.nClstockamount, 0)) As nUnrealprlo, (nvl(tblBuySell.nSellAmount, 0) - nvl(tblOpening.nOpStockAmount, 0) - nvl(tblBuySell.nBuyAmount, 0) + nvl(tblClosing.nClStockAmount, 0)) + ((Market.Market * nvl(tblClosing.nClstockquantity, 0)) - Nvl(tblClosing.nClstockamount, 0)) As nOverallprlo, Market.Market as nMarketrate, Market.Market*Nvl(tblClosing.nClstockquantity,0) As nMarketvalue from tblOPening tblOpening Full Join TblClosing on tblOpening.cclientcode = tblclosing.cclientcode and tblOPening.cScripcode = tblClosing.cScripcode Full Join TblBuySell on tblBuySell.cclientcode = coalesce(tblOpening.cclientcode, tblclosing.cclientcode) and tblBuySell.cScripcode = coalesce(tblOPening.cScripcode, tblClosing.cScripcode) Left Outer Join Market Market On Market.Firmnumber='NBS-000001' and Market.code=coalesce(tblOpening.cScripcode, tblclosing.cScripcode, tblBuysell.cScripcode) ), tblOpendet as (Select Ledger.Oowncode as cClientcode, '01' as cRowindicator, Sum(Ledger.Damount-Ledger.Camount)*-1 as nSecamount From Ledger Ledger Where Ledger.Firmnumber='NBS-000001' and Ledger.nFinancialyear = 2024 and (Ledger.Oowncode='BO910') and Ledger.Branchcode='143' and Substr(Ledger.Voucher,1,4)='OPNG' group by Ledger.Oowncode Union All Select tblCashcost.cClientcode as cClientcode, '01' as cRowindicator, Sum(tblCashcost.nOpstockamount) as nSecamount From tblCashcost tblCashcost group by tblCashcost.cClientcode ), tblOpenstk as (Select tblOpendet.cClientcode as cClientcode, Max(tblOpendet.cRowindicator) as cRowindicator, 0 as nFiramount, Sum(tblOpendet.nSecamount) as nSecamount From tblOpendet tblOpendet group by tblOpendet.cClientcode), tblPortcashfin as (Select tblCashcost.cClientcode as cClientcode, '04' as cRowindicator, Sum(tblCashcost.nProfitloss) as nFiramount, 0 as nSecamount From tblCashcost tblCashcost group by tblCashcost.cClientcode Union All Select tblCashcost.cClientcode as cClientcode, '25' as cRowindicator, Sum(tblCashcost.nMarketvalue) as nFiramount, 0 as nSecamount From tblCashcost tblCashcost group by tblCashcost.cClientcode Union All Select tblCashcost.cClientcode as cClientcode, '08' as cRowindicator, Sum(tblCashcost.nUnrealprlo) as nFiramount, 0 as nSecamount From tblCashcost tblCashcost group by tblCashcost.cClientcode ), tblFointernal as (Select Fosauda.Oowncode as cClientcode, Fosauda.Compcode as cScripcode, Fosauda.Strikeprice as nStrikeprice, Fosauda.Optiontype as cOptiontype, Company.Fibsacct as cScripname, Company.Expirydate as dExpirydate, Exchange.Operation as cOperation, Company.Instrutyp as cInstrutyp, Company.nBaseunit as nBaseunit, Company.cUnitofmeasurement as cUnitofmeasurement, Company.cUnitofTrading as cUnitofTrading, Company.nTradeablelot as nTradeablelot, Company.nPricenumerator as nPricenumerator, Company.nPricedenominator as nPricedenominator, Company.nGeneralnumerator as nGeneralnumerator, Company.nGeneraldenominator as nGeneraldenominator, Fosauda.Dtoftran as dBuydate, Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') or Fosauda.Optiontype != 'PO' Then Fosauda.Buysell else Case When Fosauda.Buysell = 'B' Then 'S' Else 'B' End end as cBuysell, Sum(Fosauda.quantity) as nBuyquantity, Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') Then Case When Sum(Fosauda.nValuebrokerage) = 0 then Avg(Fosauda.Final_Rat1) else Case When Fosauda.BuySell = 'B' Then Round(((Sum(Fosauda.Quantity) * Avg(Fosauda.Final_Rat1)) + Sum(Fosauda.nValuebrokerage)) / Sum(Fosauda.Quantity), 10) Else Round(((Sum(Fosauda.Quantity) * Avg(Fosauda.Final_Rat1)) - Sum(Fosauda.nValuebrokerage)) / Sum(Fosauda.Quantity), 10) End End Else Case When Fosauda.Buysell = 'B' Then Avg(Fosauda.Final_rat1) - Avg(Fosauda.Strikeprice) else Avg(Fosauda.Strikeprice) - Avg(Fosauda.Final_rat1) End End as nBuynetrate, Sum(Sum(Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') or Fosauda.Optiontype != 'PO' Then Decode(Fosauda.Buysell, 'B', Fosauda.Quantity, Fosauda.Quantity * -1) Else Decode(Fosauda.Buysell, 'S', Fosauda.Quantity, Fosauda.Quantity * -1) End)) Over(Partition By Fosauda.Oowncode, Company.Fibsacct, Fosauda.Strikeprice, Fosauda.Optiontype Order By Fosauda.Dtoftran, Fosauda.Final_Rat1 rows between current row and unbounded following) as nRunningqty, Sum(Sum(Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') or Fosauda.optiontype != 'PO' Then Decode(Fosauda.Buysell, 'B', Fosauda.Quantity, 0) Else Decode(Fosauda.Buysell, 'S', Fosauda.Quantity, 0) End)) Over(Partition By Fosauda.Oowncode, Company.Fibsacct, Fosauda.Strikeprice, Fosauda.Optiontype Order By Fosauda.Dtoftran, Fosauda.Final_Rat1 rows between current row and unbounded following) as nRunningbuytotal, Sum(Sum(Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') or Fosauda.Optiontype != 'PO' Then Decode(Fosauda.Buysell, 'S', Fosauda.Quantity, 0) Else Decode(Fosauda.Buysell, 'B', Fosauda.Quantity, 0) End)) Over(Partition By Fosauda.Oowncode, Company.Fibsacct, Fosauda.Strikeprice, Fosauda.Optiontype Order By Fosauda.Dtoftran, Fosauda.Final_Rat1 rows between current row and unbounded following) as nRunningselltotal, Sum(Sum(Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') or Fosauda.optiontype != 'PO' Then Decode(Fosauda.Buysell, 'B', Fosauda.Quantity, 0) Else Decode(Fosauda.Buysell, 'S', Fosauda.Quantity, 0) End)) Over(Partition By Fosauda.Oowncode, Company.Fibsacct, Fosauda.Strikeprice, Fosauda.Optiontype) as nSummarybuy, Sum(Sum(Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') or Fosauda.optiontype != 'PO' Then Decode(Fosauda.Buysell, 'S', Fosauda.Quantity, 0) Else Decode(Fosauda.Buysell, 'B', Fosauda.Quantity, 0) End)) Over(Partition By Fosauda.Oowncode, Company.Fibsacct, Fosauda.Strikeprice, Fosauda.Optiontype) as nSummarysell, Sum(Sum(Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') or Fosauda.Optiontype != 'PO' Then Decode(Fosauda.Buysell, 'B', Fosauda.Quantity, 0) Else Decode(Fosauda.Buysell, 'S', Fosauda.Quantity, 0) End) * Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') Then Case When Sum(Fosauda.nValuebrokerage) = 0 then Avg(Fosauda.Final_Rat1) else Case When Fosauda.BuySell = 'B' Then Round(((Sum(Fosauda.Quantity) * Avg(Fosauda.Final_Rat1)) + Sum(Fosauda.nValuebrokerage)) / Sum(Fosauda.Quantity), 10) Else Round(((Sum(Fosauda.Quantity) * Avg(Fosauda.Final_Rat1)) - Sum(Fosauda.nValuebrokerage)) / Sum(Fosauda.Quantity), 10) End End Else Abs(Avg(Fosauda.Final_Rat1) - Avg(fosauda.strikeprice)) End) Over(Partition By Fosauda.Oowncode, Company.Fibsacct, Fosauda.Strikeprice, Fosauda.Optiontype) as nSumBuyamount, Sum(Sum(Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') or Fosauda.Optiontype != 'PO' Then Decode(Fosauda.Buysell, 'S', Fosauda.Quantity, 0) Else Decode(Fosauda.Buysell, 'B', Fosauda.Quantity, 0) End) * Case When (Fosauda.saudatype != 'AS' and Fosauda.Saudatype != 'EX') Then Case When Sum(Fosauda.nValuebrokerage) = 0 then Avg(Fosauda.Final_Rat1) else Case When Fosauda.BuySell = 'B' Then Round(((Sum(Fosauda.Quantity) * Avg(Fosauda.Final_Rat1)) + Sum(Fosauda.nValuebrokerage)) / Sum(Fosauda.Quantity), 10) Else Round(((Sum(Fosauda.Quantity) * Avg(Fosauda.Final_Rat1)) - Sum(Fosauda.nValuebrokerage)) / Sum(Fosauda.Quantity), 10) End End Else Abs(Avg(Fosauda.Final_Rat1) - Avg(fosauda.strikeprice)) End) Over(Partition By Fosauda.Oowncode, Company.Fibsacct, Fosauda.Strikeprice, Fosauda.Optiontype) as nSumSellamount, Sum(Sum(Case When (Fosauda.Saudatype != 'AS' and Fosauda.Saudatype != 'EX') or Fosauda.optiontype != 'PO' Then Decode(Fosauda.Buysell, 'B', Fosauda.Quantity, Fosauda.Quantity * -1) Else Decode(Fosauda.Buysell, 'S', Fosauda.Quantity, Fosauda.Quantity * -1) End)) Over(Partition By Fosauda.Oowncode, Company.Fibsacct, Fosauda.Strikeprice, Fosauda.Optiontype) As nNetquantity From Fosauda Fosauda Inner Join Company Company On Fosauda.firmnumber = Company.Firmnumber and Fosauda.Compcode = Company.oowncode Inner Join Exchange Exchange On Fosauda.Firmnumber = Exchange.Firmnumber and Fosauda.Exchcode = Exchange.Code Where Fosauda.Firmnumber = 'NBS-000001' and Fosauda.Egroup != 'YF' and Fosauda.Egroup != 'LB' and Fosauda.Egroup != 'SR' and Fosauda.Egroup != 'LA' and Fosauda.Sterminal != '99999' and (Fosauda.Oowncode='BO910') and Fosauda.Brcode='143' and Fosauda.Dtoftran>=to_date('01/04/2023','dd/mm/yyyy') and Fosauda.Dtoftran<=to_date('31/03/2024','dd/mm/yyyy') and ((Fosauda.Saudatype != 'B/' and Fosauda.Orignalno = 0) or (Fosauda.Saudatype = 'B/' and (Fosauda.Orignalno = -99 or Fosauda.Dtoftran=to_date('01/04/2023','dd/mm/yyyy')))) group by Fosauda.Oowncode, Company.Fibsacct, Company.Expirydate, Exchange.Operation, Company.Instrutyp, Company.nBaseunit, Company.cUnitofmeasurement, Company.cUnitofTrading, Company.nTradeablelot, Company.nPricenumerator, Company.nPricedenominator, Company.nGeneralnumerator, Company.nGeneraldenominator, Fosauda.Dtoftran, Fosauda.Final_Rat1, Fosauda.buysell, Fosauda.Compcode, Fosauda.Strikeprice, Fosauda.Saudatype, Fosauda.Optiontype), tblFocost as (Select tblFointernal.cClientcode as cClientcode, tblFointernal.cScripcode as cScripcode, tblFointernal.nStrikeprice as nStrikeprice, tblFointernal.cOptiontype as cOptiontype, tblFointernal.cScripname as cScripname, tblFointernal.cOperation as cOperation, tblFoInternal.cInstrutyp as cInstrutyp, tblFoInternal.nBaseunit as nBaseunit, tblFoInternal.cUnitofmeasurement as cUnitofmeasurement, tblFoInternal.cUnitofTrading as cUnitofTrading, tblFoInternal.nTradeablelot as nTradeablelot, tblFoInternal.nPricenumerator as nPricenumerator, tblFoInternal.nPricedenominator as nPricedenominator, tblFoInternal.nGeneralnumerator as nGeneralnumerator, tblFoInternal.nGeneraldenominator as nGeneraldenominator, tblFointernal.dExpirydate as dExpirydate, tblFointernal.dBuydate as dBuydate, tblFointernal.nBuynetrate as nBuynetrate, Case When tblFointernal.nNetquantity = 0 Then 0 When tblFointernal.nNetquantity > 0 Then Case When tblFointernal.nRunningbuytotal > tblFointernal.nNetquantity Then tblFointernal.nNetquantity + tblFointernal.nBuyquantity - tblFointernal.nRunningbuytotal Else tblFointernal.nBuyquantity End When tblFointernal.nNetquantity < 0 Then Case When abs(tblFointernal.nRunningselltotal) > abs(tblFointernal.nNetquantity) Then tblFointernal.nNetquantity - tblFointernal.nBuyquantity + tblFointernal.nRunningselltotal Else tblFointernal.nBuyquantity * -1 End End AS nStockquantity, tblFointernal.nSummarybuy as nSummarybuy, tblFointernal.nSumBuyamount as nSumbuyamount, tblFointernal.nSummarysell as nSummarysell, tblFointernal.nSumSellamount as nSumsellamount From tblFointernal tblFoInternal Where (tblFointernal.nNetquantity > 0 and tblFointernal.cBuysell = 'B' and tblFointernal.nRunningbuytotal <= tblFointernal.nNetquantity + tblFointernal.nBuyquantity) or (tblFointernal.nNetquantity < 0 and tblFointernal.cBuysell = 'S' and abs(tblFointernal.nRunningselltotal) <= Abs(tblFointernal.nNetquantity) + tblFointernal.nBuyquantity) or (tblFointernal.nNetquantity = 0 And tblFointernal.nRunningselltotal = tblFointernal.nSummarysell and tblFointernal.nRunningbuytotal = tblFointernal.nSummarybuy)), tblFinalcost as (Select tblFocost.cClientcode as cClientcode, tblFocost.cScripcode as cScripcode, tblFocost.nStrikeprice as nStrikeprice, tblFocost.cOptiontype as cOptiontype, tblFocost.dExpirydate as dExpirydate, tblFocost.cScripname as cScripname, tblFocost.cOperation as cOperation, tblFocost.cInstrutyp as cInstrutyp, tblFocost.nBaseunit as nBaseunit, tblFocost.cUnitofmeasurement as cUnitofmeasurement, tblFocost.cUnitofTrading as cUnitofTrading, tblFocost.nTradeablelot as nTradeablelot, tblFocost.nPricenumerator as nPricenumerator, tblFocost.nPricedenominator as nPricedenominator, tblFocost.nGeneralnumerator as nGeneralnumerator, tblFocost.nGeneraldenominator as nGeneraldenominator, tblFocost.nSummarybuy - (Case When Sum(tblFocost.nStockquantity) > 0 then Sum(tblFocost.nStockquantity) else 0 end) As nPurchqty, tblFocost.nSumbuyamount - (Case When Sum(tblFocost.nStockquantity) > 0 then Sum(tblFocost.nStockquantity * tblFocost.nBuyNetRate) else 0 end) As nPurchvalue, tblFocost.nSummarysell - (Case When Sum(tblFocost.nStockquantity) < 0 then Sum(Abs(tblFocost.nStockquantity)) else 0 end) as nSalesqty, tblFocost.nSumSellamount - (Case When Sum(tblFocost.nStockquantity) < 0 then Sum(Abs(tblFocost.nStockquantity) * tblFocost.nBuyNetRate) else 0 end) as nSalesvalue, Sum(tblFocost.nStockquantity) As nOsstock, Case When Sum(tblFocost.nStockquantity) != 0 then Round(Sum(tblFocost.nStockquantity * tblFocost.nBuyNetRate) / Sum(tblFocost.nStockquantity), 4) else 0 end as nOsstockavg, Sum(tblFocost.nStockquantity * tblFocost.nBuyNetRate) as nOsstockvalue, tblFocost.nSumSellamount + Sum(tblFocost.nStockquantity * tblFocost.nBuyNetRate) - tblFocost.nSumBuyamount as nProfitLoss, Max(Market.Market) as nMarketrate, Max(Market.Market) * Sum(tblFocost.nStockquantity) as nMarketvalue, ((tblFocost.nSumSellamount + Sum(tblFocost.nStockquantity * tblFocost.nBuyNetRate) - tblFocost.nSumBuyamount)) + ((Max(Market.Market) * Sum(tblFocost.nStockquantity)) - (Sum(tblFocost.nStockquantity * tblFocost.nBuyNetRate))) as nOverallprlo, Max(Market.nPrvcloseprice) as nPrvcloseprice, Max(Market.nHighprice) as nHighprice, Max(Market.nLowprice) as nLowprice, Max(Market.nLowercircuitLimit) as nLowercircuitlimit, Max(Market.nOpenprice) as nOpenprice, Max(Market.nUppercircuitlimit) as nUppercircuitlimit, Max(Market.nNoofTrades) as nNooftrades, Max(Market.nVoltradedToday) as nVoltradedtoday, Max(Market.nVolquantity) as nVolquantity, Max(Market.dLastupdatedate) as dlastupdatedate, Max(Market.n52Weeklow) as n52Weeklow, Max(Market.n52WeekHigh) as n52Weekhigh From tblFocost tblFocost Left Outer Join Market Market On Market.Firmnumber = 'NBS-000001' and tblFocost.cScripcode = Market.Code and tblFocost.nStrikeprice = Market.Strikeprice and tblFocost.cOptiontype = Market.Optiontype and ((Market.nOptmethod = 0 and tblFocost.nStrikeprice = 0) or (Market.nOptmethod = 1 and tblFocost.nStrikeprice != 0)) Group By tblFocost.cClientcode, tblFocost.cScripcode, tblFocost.cScripname, tblFocost.cOperation, tblFocost.cInstrutyp, tblFocost.nBaseunit, tblFocost.cUnitofmeasurement, tblFocost.cUnitofTrading, tblFocost.nTradeablelot, tblFocost.nPricenumerator, tblFocost.nPricedenominator, tblFocost.nGeneralnumerator, tblFocost.nGeneraldenominator, tblFocost.dExpirydate, tblFocost.nStrikeprice, tblFocost.cOptiontype, tblFocost.nSummarybuy, tblFocost.nSumBuyamount, tblFocost.nSummarysell, tblFocost.nSumSellamount), tblPortderfinal as (Select tblFinalcost.cClientcode as cClientcode, tblFinalcost.cScripcode as cScripcode, tblFinalcost.cScripname as cScripname, tblFinalcost.cOperation as cOperation, tblFinalcost.cInstrutyp as cInstrutyp, tblFinalcost.nBaseunit as nBaseunit, tblFinalcost.cUnitofmeasurement as cUnitofmeasurement, tblFinalcost.cUnitofTrading as cUnitofTrading, tblFinalcost.nTradeablelot as nTradeablelot, tblFinalcost.nPricenumerator as nPricenumerator, tblFinalcost.nPricedenominator as nPricedenominator, tblFinalcost.nGeneralnumerator as nGeneralnumerator, tblFinalcost.nGeneraldenominator as nGeneraldenominator, tblFinalcost.nStrikeprice as nStrikeprice, tblFinalcost.cOptiontype as cOptiontype, tblFinalcost.dExpirydate as dExpirydate, tblFinalcost.nPurchqty As nPurchqty, tblFinalcost.nPurchvalue As nPurchvalue, Round(Case When tblFinalcost.nPurchqty != 0 then tblFinalcost.nPurchvalue / tblFinalcost.nPurchqty else 0 End, 4) As nPurchavg, tblFinalcost.nSalesqty as nSalesqty, tblFinalcost.nSalesvalue as nSalesvalue, Round(Case When tblFinalcost.nSalesqty != 0 then tblFinalcost.nSalesvalue / tblFinalcost.nSalesqty else 0 end, 4) as nSalesavg, tblFinalcost.nOsstock As nOsstock, tblFinalcost.nOsstockavg as nOsstockavg, tblFinalcost.nOsstockvalue as nOsstockvalue, tblFinalcost.nMarketrate as nMarketrate, tblFinalcost.nMarketvalue as nMarketvalue, ((tblFinalcost.nMarketrate * tblFinalcost.nOsstock) - (tblFinalcost.nOsstock * tblFinalcost.nOsstockavg)) as nUnrealprlo, tblFinalcost.nProfitloss as nProfitLoss, tblFinalcost.nOverallprlo as nOverallprlo, tblFinalcost.nPrvcloseprice as nPrvcloseprice, tblFinalcost.nHighprice as nHighprice, tblFinalcost.nLowprice as nLowprice, tblFinalcost.nLowercircuitLimit as nLowercircuitlimit, tblFinalcost.nOpenprice as nOpenprice, tblFinalcost.nUppercircuitlimit as nUppercircuitlimit, tblFinalcost.nNooftrades as nNooftrades, tblFinalcost.nVoltradedtoday as nVoltradedtoday, tblFinalcost.nVolquantity as nVolquantity, tblFinalcost.dLastupdatedate as dlastupdatedate, tblFinalcost.n52WeekLow as n52Weeklow, tblFinalcost.n52Weekhigh as n52Weekhigh From tblFinalcost tblFinalcost Order by tblFinalcost.cClientcode, tblFinalcost.cScripname, tblFinalcost.nStrikeprice, tblFinalcost.cOptiontype, tblFinalcost.dExpirydate ), tblPortderfin as (Select tblPortderfinal.cClientcode as cClientcode, '05' as cRowindicator, Sum(tblPortderfinal.nProfitloss) as nFiramount, 0 as nSecamount From tblPortderfinal tblPortderfinal group by tblPortderfinal.cClientcode Union All Select tblPortderfinal.cClientcode as cClientcode, '09' as cRowindicator, Sum(tblPortderfinal.nUnrealprlo) as nFiramount, 0 as nSecamount From tblPortderfinal tblPortderfinal group by tblPortderfinal.cClientcode), tblCashplusderfinal as (Select Coalesce(tblPortcashfin.cClientcode,tblPortderfin.cClientcode) as cClientcode, Case When Coalesce(tblPortcashfin.cRowindicator,tblPortderfin.cRowindicator)='04' or Coalesce(tblPortcashfin.cRowindicator,tblPortderfin.cRowindicator)='05' then '06' else '10' end as cRowindicator, 0 as nFiramount, Sum(Coalesce(tblPortcashfin.nFiramount,tblPortderfin.nFiramount,0)) as nSecamount From tblPortcashfin Full outer join tblPortderfin On tblPortcashfin.cClientcode=tblPortderfin.cClientcode and tblPortcashfin.cRowindicator=tblPortderfin.cRowindicator Where tblPortcashfin.cRowindicator='04' or tblPortcashfin.cRowindicator='08' or tblPortderfin.cRowindicator='05' or tblPortderfin.cRowindicator='09' group by Coalesce(tblPortcashfin.cClientcode,tblPortderfin.cClientcode) , Case When Coalesce(tblPortcashfin.cRowindicator,tblPortderfin.cRowindicator)='04' or Coalesce(tblPortcashfin.cRowindicator,tblPortderfin.cRowindicator)='05' then '06' else '10' end ), tblDividend as (Select Ledger.Oowncode as cClientcode, '11' as cRowindicator, 0 as nFiramount, Sum(Ledger.damount-Ledger.Camount)*-1 as nSecamount From Ledger Ledger Inner Join Journal On Ledger.Firmnumber=Journal.Firmnumber and Ledger.Voucher=Journal.Jvnumber and Ledger.nFinancialyear=Journal.nFinancialyear Where Ledger.Firmnumber='NBS-000001' and Ledger.nFinancialyear=2024 and (Ledger.Oowncode='BO910') and Ledger.Branchcode='143' and Ledger.Dtoftran>=to_date('01/04/2023','dd/mm/yyyy') and Ledger.Dtoftran<=to_date('31/03/2024','dd/mm/yyyy') and Journal.nEntrytype=1 group by Ledger.Oowncode ), tblDirectDividend as (Select tblDirectdiv.cClientcode as cClientcode, '16' as cRowindicator, 0 as nFiramount, Sum(tblDirectdiv.nQuantity*tblDirectdiv.nRate)*-1 as nSecamount From tblDirectdiv tblDirectdiv Inner Join Ldfibs Ldfibs On tblDirectdiv.cFirmnumber = Ldfibs.Firmnumber and tblDirectdiv.cClientcode = Ldfibs.Oowncode Where tblDirectdiv.cFirmnumber='NBS-000001' and (tblDirectdiv.cClientcode='BO910') and tblDirectdiv.dDtoftran>=to_date('01/04/2023','dd/mm/yyyy') and tblDirectdiv.dDtoftran<=to_date('31/03/2024','dd/mm/yyyy') group by tblDirectdiv.cClientcode ), tbltmpBillcharges as (Select Billcharges.Oowncode as cClientcode, Case When Billcharges.Egroup='FU' then '14' else '13' end as cRowindicator, Sum(Billcharges.Quantity*Billcharges.Final_Rat1) as nFiramount, 0 as nSecamount From Billcharges Billcharges Where Billcharges.Firmnumber='NBS-000001' and Billcharges.Brcode='143' and (Billcharges.Oowncode='BO910') and Billcharges.Dtoftran>=to_date('01/04/2023','dd/mm/yyyy') and Billcharges.Dtoftran<=to_date('31/03/2024','dd/mm/yyyy') group by Billcharges.Oowncode, Case When Billcharges.Egroup='FU' then '14' else '13' end ), tbltmpbillchgtotal as (Select tbltmpBillcharges.cClientcode as cClientcode, '12' as cRowindicator, 0 as nFiramount, Sum(tbltmpBillcharges.nFiramount) as nSecamount from tbltmpBillcharges tbltmpBillcharges group by tbltmpbillcharges.cClientcode ), tblMiscentries as ( Select Ledger.Oowncode as cClientcode, '15' as cRowindicator, 0 as nFiramount, Sum(Ledger.damount-Ledger.Camount)*-1 as nSecamount From Ledger Ledger Inner Join Journal On Ledger.Firmnumber=Journal.Firmnumber and Ledger.Voucher=Journal.Jvnumber and Ledger.nFinancialyear=Journal.nFinancialyear Where Ledger.Firmnumber='NBS-000001' and Ledger.nFinancialyear=2024 and (Ledger.Oowncode='BO910') and Ledger.Branchcode='143' and Ledger.Dtoftran>=to_date('01/04/2023','dd/mm/yyyy') and Ledger.Dtoftran<=to_date('31/03/2024','dd/mm/yyyy') and Journal.nEntrytype!=1 group by Ledger.Oowncode ), tbltempportalloc as (Select Coalesce(tblFinledger.cClientcode,tblPortcashfin.cClientcode) as cClientcode, '27' as cRowindicator, Sum(Nvl(tblFinledger.nFiramount,0)+Nvl(tblPortcashfin.nFiramount,0)) as nFiramount, 0 as nSecamount From tblFinledger tblFinledger Full Outer Join tblPortcashfin On tblFinledger.cClientcode=tblPortcashfin.cClientcode and tblFinledger.cRowindicator=tblPortcashfin.cRowindicator Where (tblFinledger.cRowindicator='26' or tblPortcashfin.cRowindicator='25') group by Coalesce(tblFinledger.cClientcode,tblPortcashfin.cClientcode) ), tbltemptotdays as (Select '18' as cRowindicator, (to_date('31/03/2024','dd/mm/yyyy') - to_date('01/04/2024','dd/mm/yyyy'))+1 as nSecamount From dual ), tblFinalloop as (Select tblReportdesc.cRowindicator as cRowindicator, tblReportdesc.cRowdesc as cRowdesc, Coalesce(tblReportdesc.cClientcode,tblOpenstk.cClientcode,tblCapinout.cClientcode,tblPortcashfin.cClientcode,tblPortderfin.cClientcode,tblCashplusderfinal.cClientcode,tblDividend.cClientcode,tbltmpbillcharges.cClientcode,tbltmpbillchgtotal.cClientcode,tblMiscentries.cClientcode,tblFinledger.cClientcode,tbltempPortalloc.cClientcode,tblDirectdividend.cClientcode) as cClientcode, Coalesce(tblOpenstk.nFiramount,tblCapinout.nFiramount,tblPortcashfin.nFiramount,tblPortderfin.nFiramount,tblCashplusderfinal.nFiramount,tblDividend.nFiramount,tbltmpBillcharges.nFiramount,tbltmpbillchgtotal.nFiramount,tblMiscentries.nFiramount,tblFinledger.nFiramount,tbltempPortalloc.nFiramount,tblDirectdividend.nFiramount) as nFiramount, Coalesce(tblOpenstk.nSecamount,tblCapinout.nSecamount,tblPortcashfin.nSecamount,tblPortderfin.nSecamount,tblCashplusderfinal.nSecamount,tblDividend.nSecamount,tbltmpBillcharges.nSecamount,tbltmpBillchgtotal.nSecamount,tblMiscentries.nSecamount,tblFinledger.nSecamount,tbltempPortalloc.nSecamount,tbltempTotdays.nSecamount,tbltempTotdays.nSecamount) as nSecamount From tblReportdesc tblReportdesc Left Outer Join tblOpenstk On tblReportdesc.cRowindicator=tblOpenstk.cRowindicator and tblReportdesc.cClientcode=tblOpenstk.cClientcode Left Outer Join tblCapinout On tblReportdesc.cRowindicator=tblCapinout.cRowindicator and tblReportdesc.cClientcode=tblCapinout.cClientcode Left Outer Join tblPortcashfin On tblReportdesc.cRowindicator=tblPortcashfin.cRowindicator and tblReportdesc.cClientcode=tblPortcashfin.cClientcode Left Outer Join tblPortderfin On tblReportdesc.cRowindicator=tblPortderfin.cRowindicator and tblReportdesc.cClientcode=tblPortderfin.cClientcode Left Outer Join tblCashplusderfinal On tblReportdesc.cRowindicator=tblCashplusderfinal.cRowindicator and tblReportdesc.cClientcode=tblCashplusderfinal.cClientcode Left Outer Join tblDividend On tblReportdesc.cRowindicator=tblDividend.cRowindicator and tblReportdesc.cClientcode=tblDividend.cClientcode Left Outer Join tbltmpBillcharges On tblReportdesc.cRowindicator=tbltmpBillcharges.cRowindicator and tblReportdesc.cClientcode=tbltmpBillcharges.cClientcode Left Outer Join tbltmpbillchgtotal On tblReportdesc.cRowindicator=tbltmpBillchgtotal.cRowindicator and tblReportdesc.cClientcode=tbltmpBillchgtotal.cClientcode Left Outer Join tblMiscentries On tblReportdesc.cRowindicator=tblMiscentries.cRowindicator and tblReportdesc.cClientcode=tblMiscentries.cClientcode Left Outer Join tblFinledger On tblReportdesc.cRowindicator=tblFinledger.cRowindicator and tblReportdesc.cClientcode=tblFinledger.cClientcode Left Outer Join tbltempPortalloc On tblReportdesc.cRowindicator=tbltempPortalloc.cRowindicator and tblReportdesc.cClientcode=tbltempPortalloc.cClientcode Left Outer Join tblDirectdividend On tblReportdesc.cRowindicator=tblDirectdividend.cRowindicator and tblReportdesc.cClientcode=tblDirectdividend.cClientcode Left Outer Join tbltemptotdays On tblReportdesc.cRowindicator=tbltempTotdays.cRowindicator ), tbltempporttotal as ( Select '17' as cRowindicator, tblFinalloop.cClientcode as cClientcode, Sum(tblFinalloop.nSecamount) as nTotalamount From tblFinalloop Where tblFinalloop.cRowindicator!='18' and nvl(trim(tblFinalloop.cClientcode),' ')!=' ' group by tblFinalloop.cClientcode ), tbltemptotalcapital as ( Select tblFinalloop.cClientcode as cClientcode, Sum(tblFinalloop.nSecamount) as nTotalamount From tblFinalloop tblFinalloop Where (tblFinalloop.cRowindicator='02' or tblFinalloop.cRowindicator='01') and nvl(trim(tblFinalloop.cClientcode),' ')!=' ' group by tblFinalloop.cClientcode ) Select tblFinalloop.cRowindicator as cRowindicator, tblFinalloop.cRowdesc as cRowdesc, tblFinalloop.cClientcode as cClientcode, tblFinalloop.nFiramount as nFiramount, Case When (tblFinalloop.cRowindicator=25 or tblFinalloop.cRowindicator=26) and tbltempPortalloc.nFiramount!=0 then Round(tblFinalloop.nFiramount/tbltempPortalloc.nFiramount*100,2) When tblFInalloop.cRowindicator='17' then tbltempporttotal.nTotalamount When tblFinalloop.cRowindicator='19' and tbltemptotalcapital.nTotalamount!=0 then Round((tbltempporttotal.nTotalamount-tbltemptotalcapital.nTotalamount)*100/tbltemptotalcapital.nTotalamount,2) When tblFinalloop.cRowindicator='20' and tbltemptotalcapital.nTotalamount!=0 then Round(((tbltempporttotal.nTotalamount-tbltemptotalcapital.nTotalamount)*100/tbltemptotalcapital.nTotalamount)*365/ ((to_date('31/03/2024','dd/mm/yyyy') - to_date('01/04/2024','dd/mm/yyyy')+1)),2) else tblFinalloop.nSecamount end as nSecamount From tblFinalloop Left Outer Join tbltempportalloc On tblFinalloop.cClientcode=tbltempportalloc.cClientcode Left Outer Join tbltempporttotal On tblFinalloop.cClientcode=tbltempporttotal.cClientcode Left Outer Join tbltemptotalcapital On tblFinalloop.cClientcode=tbltemptotalcapital.cClientcode Order by 1 Title : 01~Error Description : ORA-01476: divisor is equal to zero Method : getglobalportfolioLine : 44015 Message : getGlobalportfolio StackTrace : at OracleInternal.ServiceObjects.OracleConnectionImpl.VerifyExecution(Int32& cursorId, Boolean bThrowArrayBindRelatedErrors, SqlStatementType sqlStatementType, Int32 arrayBindCount, OracleException& exceptionForArrayBindDML, Boolean& hasMoreRowsInDB, Boolean bFirstIterationDone) at OracleInternal.ServiceObjects.OracleCommandImpl.ExecuteReader(String commandText, OracleParameterCollection paramColl, CommandType commandType, OracleConnectionImpl connectionImpl, OracleDataReaderImpl& rdrImpl, Int32 longFetchSize, Int64 clientInitialLOBFS, OracleDependencyImpl orclDependencyImpl, Int64[] scnForExecution, Int64[]& scnFromExecution, OracleParameterCollection& bindByPositionParamColl, Boolean& bBindParamPresent, Int64& internalInitialLOBFS, OracleException& exceptionForArrayBindDML, OracleConnection connection, OracleLogicalTransaction& oracleLogicalTransaction, IEnumerable`1 adrianParsedStmt, Boolean isDescribeOnly, Boolean isFromEF) at Oracle.ManagedDataAccess.Client.OracleCommand.ExecuteReader(Boolean requery, Boolean fillRequest, CommandBehavior behavior) at Oracle.ManagedDataAccess.Client.OracleDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable) at clientlevel.Thinclientlevel.Clientlogin.getglobalportfolio(DateTime tdStartdate, DateTime tdEnddate, DateTime tdPoadate, DateTime tdFinancialstartdate, Int32 tnAngleselection, String tcClientfilter, Cliole loLdcommon) in File25:line 44015 Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 565952512 Shut down : N Username : MOBBO Date/Time : 18/05/2024 12:33:41 PM Connection : Closed =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKR5120485Image180524124008.png$N$~ Message : UpdateEkycdata StackTrace : tpDocimageforBank Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 1073668096 Shut down : N Username : MOBBO Date/Time : 18/05/2024 12:40:26 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKR5120485Image180524124008.png$N$ Message : UpdateEkycdata StackTrace : lcDocsrtring[i] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 1073668096 Shut down : N Username : MOBBO Date/Time : 18/05/2024 12:40:26 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKR5120485Image180524124008.png Message : UpdateEkycdata StackTrace : lcProoffile[0] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 1073668096 Shut down : N Username : MOBBO Date/Time : 18/05/2024 12:40:26 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Select tblFirmcreation.cshortname as cShortname From tblFirmcreation tblFirmcreation Where tblFirmcreation.cUserFirmcode='NBS-000001' Title : 01~Error Description : Value cannot be null. Parameter name: dataTable Method : AgeingacrossyearLine : 46316 Message : Ageingacrossyear StackTrace : at System.Data.Common.DataAdapter.Fill(DataTable[] dataTables, IDataReader dataReader, Int32 startRecord, Int32 maxRecords) at Oracle.ManagedDataAccess.Client.OracleDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable) at clientlevel.Thinclientlevel.Clientlogin.Ageingacrossyear(DateTime tdTransactiondate, Int32 tnTotaldays1, Int32 tnTotaldays2, Int32 tnTotaldays3, Int32 tnAngleselection, Int32 tnTotaldays4, Int32 tnTotaldays5, Int32 tnTotaldays6, Cliole loLdcommon, Int32 tnTotaldays7, Int32 tnTotaldays8, Int32 tnTotaldays9, Int32 tnTotaldays10, Int32 tnTotaldays11, Int32 tnTotaldays12, Int32 tnIncludepreviousyear, Int32 tnIgnorebounced, Int32 tnonlyReconciledentries, Int32 tnTerminalcodejoin, String& tcCashpayindate, String& tcFopayindate, Int32 tnAgeingonTransactiondate, String tcClientcode, Double tnAmount, String& tcSebiageingdate) in File25:line 46316 Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 815357952 Shut down : N Username : MOBBO Date/Time : 18/05/2024 12:57:22 PM Connection : Closed =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Select tblFirmcreation.cshortname as cShortname From tblFirmcreation tblFirmcreation Where tblFirmcreation.cUserFirmcode='NBS-000001' Title : 01~Error Description : Value cannot be null. Parameter name: dataTable Method : AgeingacrossyearLine : 46316 Message : Ageingacrossyear StackTrace : at System.Data.Common.DataAdapter.Fill(DataTable[] dataTables, IDataReader dataReader, Int32 startRecord, Int32 maxRecords) at Oracle.ManagedDataAccess.Client.OracleDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable) at clientlevel.Thinclientlevel.Clientlogin.Ageingacrossyear(DateTime tdTransactiondate, Int32 tnTotaldays1, Int32 tnTotaldays2, Int32 tnTotaldays3, Int32 tnAngleselection, Int32 tnTotaldays4, Int32 tnTotaldays5, Int32 tnTotaldays6, Cliole loLdcommon, Int32 tnTotaldays7, Int32 tnTotaldays8, Int32 tnTotaldays9, Int32 tnTotaldays10, Int32 tnTotaldays11, Int32 tnTotaldays12, Int32 tnIncludepreviousyear, Int32 tnIgnorebounced, Int32 tnonlyReconciledentries, Int32 tnTerminalcodejoin, String& tcCashpayindate, String& tcFopayindate, Int32 tnAgeingonTransactiondate, String tcClientcode, Double tnAmount, String& tcSebiageingdate) in File25:line 46316 Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 821276672 Shut down : N Username : MOBBO Date/Time : 18/05/2024 12:57:27 PM Connection : Closed =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKH4550095Image180524010346.png$N$~ Message : UpdateEkycdata StackTrace : tpDocimageforBank Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 657240064 Shut down : N Username : MOBBO Date/Time : 18/05/2024 1:04:25 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKH4550095Image180524010346.png$N$ Message : UpdateEkycdata StackTrace : lcDocsrtring[i] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 657281024 Shut down : N Username : MOBBO Date/Time : 18/05/2024 1:04:25 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKH4550095Image180524010346.png Message : UpdateEkycdata StackTrace : lcProoffile[0] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 657305600 Shut down : N Username : MOBBO Date/Time : 18/05/2024 1:04:25 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Merge into ldccm.tblccmekycsegmentdetails@lnk_ccm T1 using ( Select 'NBS-000001' as cFirmnumber, 'L1130111' as cClientcode,34170 as nEkycrefno, :lcSegselected as cSegselected, :lcExch as cExch, :lcActivation as cActivation, :lcCommodityItem as cCommodityitem, nvl('',' ') as csubcatdesc, 'N' as cDerConsentgiven from dual ) T2 on (T1.cFirmnumber=T2.cFirmnumber and T1.cClientcode=T2.cClientcode and T1.nEkycdoucmentno=T2.nEkycrefno and T1.cExchange = T2.cExch and T1.cSegmenttype= T2.cSegselected) when matched then update set cFlag = T2.cActivation, cCommodityitem= T2.cCommodityitem, csubcatdesc=T2.csubcatdesc, cDerConsentgiven = T2.cDerConsentgiven when not matched then Insert (cFirmnumber,cClientcode ,nEkycdoucmentno,cExchange,cFlag,cSegmenttype,cSchemecode, cCommodityitem, csubcatdesc, cDerConsentgiven) Values (T2.cFirmnumber, T2.cClientcode, T2.nEkycrefno, T2.cExch, T2.cActivation, T2.cSegselected, 'TEST', T2.cCommodityitem,T2.csubcatdesc, T2.cDerConsentgiven ) Title : 01~Error Description : ORA-00904: "CDERCONSENTGIVEN": invalid identifier Method : UpdateEkycdataLine : 71242 Message : UpdateEkycdata StackTrace : at OracleInternal.ServiceObjects.OracleConnectionImpl.VerifyExecution(Int32& cursorId, Boolean bThrowArrayBindRelatedErrors, SqlStatementType sqlStatementType, Int32 arrayBindCount, OracleException& exceptionForArrayBindDML, Boolean& hasMoreRowsInDB, Boolean bFirstIterationDone) at OracleInternal.ServiceObjects.OracleCommandImpl.ExecuteNonQuery(String commandText, OracleParameterCollection paramColl, CommandType commandType, OracleConnectionImpl connectionImpl, Int32 longFetchSize, Int64 clientInitialLOBFS, OracleDependencyImpl orclDependencyImpl, Int64[]& scnFromExecution, OracleParameterCollection& bindByPositionParamColl, Boolean& bBindParamPresent, OracleException& exceptionForArrayBindDML, OracleConnection connection, OracleLogicalTransaction& oracleLogicalTransaction, Boolean isFromEF) at Oracle.ManagedDataAccess.Client.OracleCommand.ExecuteNonQuery() at ekyc.ekycdata.UpdateEkycdata(Cliole loLdcommon, Int32 tnAngleselection, String tcClientcode, String tcRequstType, String tcMobile, String tcEmailaddress, String tcClientname, String tcFirstname, String tcSecondname, String tcLastname, String tcCorraddressline1, String tcCorraddressline2, String tcCorraddressline3, String tcCorraddresscity, String tnCorrpin, String tcCorrstate, String tcCorrstateother, String tcCorrcountry, String tcCorraddressproof, String tcCorraddressrefid, String tdCorraddressproofissuedt, String tdCorraddressproofexpirydt, String tcPfraddressline1, String tcPfraddressline2, String tcPfraddressline3, String tcPfraddresscity, Int32 tnPfrpin, String tcPfrstate, String tcPfrstateother, String tcPfrcountry, String tcPfraddressproof, String tcPfraddressproofrefid, String tdPfraddressproofissuedt, String tdPfraddressproofexpirydt, String tcResdstatuscode, String tcGender, String tcMaritalstatus, String tcFatherSpousename, String tcNationality, String tcPrefixmaidenname, String tcApplicantMaidenname, String tcPrefixfatherspouse, String tcPrefixmothername, String tcMothername, String tcMothermaidenname, String tcFatcaProofofaddress, String tcFatcaIdnumber, String tcFatcataxresidence, String tcCountryofbirth, String tcCityofbirth, Int64 tnAnnualincome, Int64 tnNetworth, String tdNetworth, String tcDeviceinfo, Int32 tnUpdateKYC, Int32 tnUpdateaddress, Int32 tnUpadateFatca, Int32 tnUpdateMobile, Int32 tnUpdateemail, Int32 tnUpdateBank, Int32 tnUpdateDemat, String tcUserid, String tcFatherHusbandflag, String tpDocimageforAddress, String tpDocimageforKYC, String tpDocimageforFatca, String tcBankdetails, String tpDocimageforBank, String tcDematdetails, String tpDocimageforDemat, String tcOccupation, String tcEsigneddoneby, Int64& tnEkycDocumentno, String tcFilepath, String tcAddressasperKyc, Int64 tnEkycreferenceno, String tcUseraction, String tcIdentifier, String tcEsignPdffilename, String& tceSigndocumentid, Cliole loCCMcon, String tcEsignmethod, String tcEmailFamily, String tcEconfirmation, String tcMobilefamily, Int32 tnUpdateOtherdetails, String tdDOB, String tcAadharnumber, String tceducation, String tcInternettradingflag, String tcDPfees, String tcIBTdetails, String tcIPVproofdetails, String tcDepository, Int32 tnInternetsoftware, String tcKRAAddressIPV, Boolean tlEsignwithClientname, Int32 tnUpdatenominee, String tcNomineedetails, String tcNomineeproof, String tcClientSignaturefile, String tcNomineeopted, String tcNomineeoptout, Int32 tnUpdateSegment, String tcSegmentActivationdetails, String tcSegmentDeActivationdetails, String tcSegmentproofdetails, String tcSchemecode, String tcEsigncoordinator, String tcsubcategoryforcomm, String tcCommodiyitemlist, String tcDerConsentgiven) in File25:line 71242 Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 953782272 Shut down : N Username : MOBBO Date/Time : 18/05/2024 1:07:00 PM Connection : Closed =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Merge into ldccm.tblccmekycsegmentdetails@lnk_ccm T1 using ( Select 'NBS-000001' as cFirmnumber, 'L1130111' as cClientcode,34171 as nEkycrefno, :lcSegselected as cSegselected, :lcExch as cExch, :lcActivation as cActivation, :lcCommodityItem as cCommodityitem, nvl('',' ') as csubcatdesc, 'N' as cDerConsentgiven from dual ) T2 on (T1.cFirmnumber=T2.cFirmnumber and T1.cClientcode=T2.cClientcode and T1.nEkycdoucmentno=T2.nEkycrefno and T1.cExchange = T2.cExch and T1.cSegmenttype= T2.cSegselected) when matched then update set cFlag = T2.cActivation, cCommodityitem= T2.cCommodityitem, csubcatdesc=T2.csubcatdesc, cDerConsentgiven = T2.cDerConsentgiven when not matched then Insert (cFirmnumber,cClientcode ,nEkycdoucmentno,cExchange,cFlag,cSegmenttype,cSchemecode, cCommodityitem, csubcatdesc, cDerConsentgiven) Values (T2.cFirmnumber, T2.cClientcode, T2.nEkycrefno, T2.cExch, T2.cActivation, T2.cSegselected, 'TEST', T2.cCommodityitem,T2.csubcatdesc, T2.cDerConsentgiven ) Title : 01~Error Description : ORA-00904: "CDERCONSENTGIVEN": invalid identifier Method : UpdateEkycdataLine : 71242 Message : UpdateEkycdata StackTrace : at OracleInternal.ServiceObjects.OracleConnectionImpl.VerifyExecution(Int32& cursorId, Boolean bThrowArrayBindRelatedErrors, SqlStatementType sqlStatementType, Int32 arrayBindCount, OracleException& exceptionForArrayBindDML, Boolean& hasMoreRowsInDB, Boolean bFirstIterationDone) at OracleInternal.ServiceObjects.OracleCommandImpl.ExecuteNonQuery(String commandText, OracleParameterCollection paramColl, CommandType commandType, OracleConnectionImpl connectionImpl, Int32 longFetchSize, Int64 clientInitialLOBFS, OracleDependencyImpl orclDependencyImpl, Int64[]& scnFromExecution, OracleParameterCollection& bindByPositionParamColl, Boolean& bBindParamPresent, OracleException& exceptionForArrayBindDML, OracleConnection connection, OracleLogicalTransaction& oracleLogicalTransaction, Boolean isFromEF) at Oracle.ManagedDataAccess.Client.OracleCommand.ExecuteNonQuery() at ekyc.ekycdata.UpdateEkycdata(Cliole loLdcommon, Int32 tnAngleselection, String tcClientcode, String tcRequstType, String tcMobile, String tcEmailaddress, String tcClientname, String tcFirstname, String tcSecondname, String tcLastname, String tcCorraddressline1, String tcCorraddressline2, String tcCorraddressline3, String tcCorraddresscity, String tnCorrpin, String tcCorrstate, String tcCorrstateother, String tcCorrcountry, String tcCorraddressproof, String tcCorraddressrefid, String tdCorraddressproofissuedt, String tdCorraddressproofexpirydt, String tcPfraddressline1, String tcPfraddressline2, String tcPfraddressline3, String tcPfraddresscity, Int32 tnPfrpin, String tcPfrstate, String tcPfrstateother, String tcPfrcountry, String tcPfraddressproof, String tcPfraddressproofrefid, String tdPfraddressproofissuedt, String tdPfraddressproofexpirydt, String tcResdstatuscode, String tcGender, String tcMaritalstatus, String tcFatherSpousename, String tcNationality, String tcPrefixmaidenname, String tcApplicantMaidenname, String tcPrefixfatherspouse, String tcPrefixmothername, String tcMothername, String tcMothermaidenname, String tcFatcaProofofaddress, String tcFatcaIdnumber, String tcFatcataxresidence, String tcCountryofbirth, String tcCityofbirth, Int64 tnAnnualincome, Int64 tnNetworth, String tdNetworth, String tcDeviceinfo, Int32 tnUpdateKYC, Int32 tnUpdateaddress, Int32 tnUpadateFatca, Int32 tnUpdateMobile, Int32 tnUpdateemail, Int32 tnUpdateBank, Int32 tnUpdateDemat, String tcUserid, String tcFatherHusbandflag, String tpDocimageforAddress, String tpDocimageforKYC, String tpDocimageforFatca, String tcBankdetails, String tpDocimageforBank, String tcDematdetails, String tpDocimageforDemat, String tcOccupation, String tcEsigneddoneby, Int64& tnEkycDocumentno, String tcFilepath, String tcAddressasperKyc, Int64 tnEkycreferenceno, String tcUseraction, String tcIdentifier, String tcEsignPdffilename, String& tceSigndocumentid, Cliole loCCMcon, String tcEsignmethod, String tcEmailFamily, String tcEconfirmation, String tcMobilefamily, Int32 tnUpdateOtherdetails, String tdDOB, String tcAadharnumber, String tceducation, String tcInternettradingflag, String tcDPfees, String tcIBTdetails, String tcIPVproofdetails, String tcDepository, Int32 tnInternetsoftware, String tcKRAAddressIPV, Boolean tlEsignwithClientname, Int32 tnUpdatenominee, String tcNomineedetails, String tcNomineeproof, String tcClientSignaturefile, String tcNomineeopted, String tcNomineeoptout, Int32 tnUpdateSegment, String tcSegmentActivationdetails, String tcSegmentDeActivationdetails, String tcSegmentproofdetails, String tcSchemecode, String tcEsigncoordinator, String tcsubcategoryforcomm, String tcCommodiyitemlist, String tcDerConsentgiven) in File25:line 71242 Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 981442560 Shut down : N Username : MOBBO Date/Time : 18/05/2024 1:07:21 PM Connection : Closed =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Merge into ldccm.tblccmekycsegmentdetails@lnk_ccm T1 using ( Select 'NBS-000001' as cFirmnumber, 'L1130111' as cClientcode,34172 as nEkycrefno, :lcSegselected as cSegselected, :lcExch as cExch, :lcActivation as cActivation, :lcCommodityItem as cCommodityitem, nvl('',' ') as csubcatdesc, 'N' as cDerConsentgiven from dual ) T2 on (T1.cFirmnumber=T2.cFirmnumber and T1.cClientcode=T2.cClientcode and T1.nEkycdoucmentno=T2.nEkycrefno and T1.cExchange = T2.cExch and T1.cSegmenttype= T2.cSegselected) when matched then update set cFlag = T2.cActivation, cCommodityitem= T2.cCommodityitem, csubcatdesc=T2.csubcatdesc, cDerConsentgiven = T2.cDerConsentgiven when not matched then Insert (cFirmnumber,cClientcode ,nEkycdoucmentno,cExchange,cFlag,cSegmenttype,cSchemecode, cCommodityitem, csubcatdesc, cDerConsentgiven) Values (T2.cFirmnumber, T2.cClientcode, T2.nEkycrefno, T2.cExch, T2.cActivation, T2.cSegselected, 'TEST', T2.cCommodityitem,T2.csubcatdesc, T2.cDerConsentgiven ) Title : 01~Error Description : ORA-00904: "CDERCONSENTGIVEN": invalid identifier Method : UpdateEkycdataLine : 71242 Message : UpdateEkycdata StackTrace : at OracleInternal.ServiceObjects.OracleConnectionImpl.VerifyExecution(Int32& cursorId, Boolean bThrowArrayBindRelatedErrors, SqlStatementType sqlStatementType, Int32 arrayBindCount, OracleException& exceptionForArrayBindDML, Boolean& hasMoreRowsInDB, Boolean bFirstIterationDone) at OracleInternal.ServiceObjects.OracleCommandImpl.ExecuteNonQuery(String commandText, OracleParameterCollection paramColl, CommandType commandType, OracleConnectionImpl connectionImpl, Int32 longFetchSize, Int64 clientInitialLOBFS, OracleDependencyImpl orclDependencyImpl, Int64[]& scnFromExecution, OracleParameterCollection& bindByPositionParamColl, Boolean& bBindParamPresent, OracleException& exceptionForArrayBindDML, OracleConnection connection, OracleLogicalTransaction& oracleLogicalTransaction, Boolean isFromEF) at Oracle.ManagedDataAccess.Client.OracleCommand.ExecuteNonQuery() at ekyc.ekycdata.UpdateEkycdata(Cliole loLdcommon, Int32 tnAngleselection, String tcClientcode, String tcRequstType, String tcMobile, String tcEmailaddress, String tcClientname, String tcFirstname, String tcSecondname, String tcLastname, String tcCorraddressline1, String tcCorraddressline2, String tcCorraddressline3, String tcCorraddresscity, String tnCorrpin, String tcCorrstate, String tcCorrstateother, String tcCorrcountry, String tcCorraddressproof, String tcCorraddressrefid, String tdCorraddressproofissuedt, String tdCorraddressproofexpirydt, String tcPfraddressline1, String tcPfraddressline2, String tcPfraddressline3, String tcPfraddresscity, Int32 tnPfrpin, String tcPfrstate, String tcPfrstateother, String tcPfrcountry, String tcPfraddressproof, String tcPfraddressproofrefid, String tdPfraddressproofissuedt, String tdPfraddressproofexpirydt, String tcResdstatuscode, String tcGender, String tcMaritalstatus, String tcFatherSpousename, String tcNationality, String tcPrefixmaidenname, String tcApplicantMaidenname, String tcPrefixfatherspouse, String tcPrefixmothername, String tcMothername, String tcMothermaidenname, String tcFatcaProofofaddress, String tcFatcaIdnumber, String tcFatcataxresidence, String tcCountryofbirth, String tcCityofbirth, Int64 tnAnnualincome, Int64 tnNetworth, String tdNetworth, String tcDeviceinfo, Int32 tnUpdateKYC, Int32 tnUpdateaddress, Int32 tnUpadateFatca, Int32 tnUpdateMobile, Int32 tnUpdateemail, Int32 tnUpdateBank, Int32 tnUpdateDemat, String tcUserid, String tcFatherHusbandflag, String tpDocimageforAddress, String tpDocimageforKYC, String tpDocimageforFatca, String tcBankdetails, String tpDocimageforBank, String tcDematdetails, String tpDocimageforDemat, String tcOccupation, String tcEsigneddoneby, Int64& tnEkycDocumentno, String tcFilepath, String tcAddressasperKyc, Int64 tnEkycreferenceno, String tcUseraction, String tcIdentifier, String tcEsignPdffilename, String& tceSigndocumentid, Cliole loCCMcon, String tcEsignmethod, String tcEmailFamily, String tcEconfirmation, String tcMobilefamily, Int32 tnUpdateOtherdetails, String tdDOB, String tcAadharnumber, String tceducation, String tcInternettradingflag, String tcDPfees, String tcIBTdetails, String tcIPVproofdetails, String tcDepository, Int32 tnInternetsoftware, String tcKRAAddressIPV, Boolean tlEsignwithClientname, Int32 tnUpdatenominee, String tcNomineedetails, String tcNomineeproof, String tcClientSignaturefile, String tcNomineeopted, String tcNomineeoptout, Int32 tnUpdateSegment, String tcSegmentActivationdetails, String tcSegmentDeActivationdetails, String tcSegmentproofdetails, String tcSchemecode, String tcEsigncoordinator, String tcsubcategoryforcomm, String tcCommodiyitemlist, String tcDerConsentgiven) in File25:line 71242 Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 1006141440 Shut down : N Username : MOBBO Date/Time : 18/05/2024 1:07:39 PM Connection : Closed =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Merge into ldccm.tblccmekycsegmentdetails@lnk_ccm T1 using ( Select 'NBS-000001' as cFirmnumber, 'L1130111' as cClientcode,34173 as nEkycrefno, :lcSegselected as cSegselected, :lcExch as cExch, :lcActivation as cActivation, :lcCommodityItem as cCommodityitem, nvl('',' ') as csubcatdesc, 'N' as cDerConsentgiven from dual ) T2 on (T1.cFirmnumber=T2.cFirmnumber and T1.cClientcode=T2.cClientcode and T1.nEkycdoucmentno=T2.nEkycrefno and T1.cExchange = T2.cExch and T1.cSegmenttype= T2.cSegselected) when matched then update set cFlag = T2.cActivation, cCommodityitem= T2.cCommodityitem, csubcatdesc=T2.csubcatdesc, cDerConsentgiven = T2.cDerConsentgiven when not matched then Insert (cFirmnumber,cClientcode ,nEkycdoucmentno,cExchange,cFlag,cSegmenttype,cSchemecode, cCommodityitem, csubcatdesc, cDerConsentgiven) Values (T2.cFirmnumber, T2.cClientcode, T2.nEkycrefno, T2.cExch, T2.cActivation, T2.cSegselected, 'TEST', T2.cCommodityitem,T2.csubcatdesc, T2.cDerConsentgiven ) Title : 01~Error Description : ORA-00904: "CDERCONSENTGIVEN": invalid identifier Method : UpdateEkycdataLine : 71242 Message : UpdateEkycdata StackTrace : at OracleInternal.ServiceObjects.OracleConnectionImpl.VerifyExecution(Int32& cursorId, Boolean bThrowArrayBindRelatedErrors, SqlStatementType sqlStatementType, Int32 arrayBindCount, OracleException& exceptionForArrayBindDML, Boolean& hasMoreRowsInDB, Boolean bFirstIterationDone) at OracleInternal.ServiceObjects.OracleCommandImpl.ExecuteNonQuery(String commandText, OracleParameterCollection paramColl, CommandType commandType, OracleConnectionImpl connectionImpl, Int32 longFetchSize, Int64 clientInitialLOBFS, OracleDependencyImpl orclDependencyImpl, Int64[]& scnFromExecution, OracleParameterCollection& bindByPositionParamColl, Boolean& bBindParamPresent, OracleException& exceptionForArrayBindDML, OracleConnection connection, OracleLogicalTransaction& oracleLogicalTransaction, Boolean isFromEF) at Oracle.ManagedDataAccess.Client.OracleCommand.ExecuteNonQuery() at ekyc.ekycdata.UpdateEkycdata(Cliole loLdcommon, Int32 tnAngleselection, String tcClientcode, String tcRequstType, String tcMobile, String tcEmailaddress, String tcClientname, String tcFirstname, String tcSecondname, String tcLastname, String tcCorraddressline1, String tcCorraddressline2, String tcCorraddressline3, String tcCorraddresscity, String tnCorrpin, String tcCorrstate, String tcCorrstateother, String tcCorrcountry, String tcCorraddressproof, String tcCorraddressrefid, String tdCorraddressproofissuedt, String tdCorraddressproofexpirydt, String tcPfraddressline1, String tcPfraddressline2, String tcPfraddressline3, String tcPfraddresscity, Int32 tnPfrpin, String tcPfrstate, String tcPfrstateother, String tcPfrcountry, String tcPfraddressproof, String tcPfraddressproofrefid, String tdPfraddressproofissuedt, String tdPfraddressproofexpirydt, String tcResdstatuscode, String tcGender, String tcMaritalstatus, String tcFatherSpousename, String tcNationality, String tcPrefixmaidenname, String tcApplicantMaidenname, String tcPrefixfatherspouse, String tcPrefixmothername, String tcMothername, String tcMothermaidenname, String tcFatcaProofofaddress, String tcFatcaIdnumber, String tcFatcataxresidence, String tcCountryofbirth, String tcCityofbirth, Int64 tnAnnualincome, Int64 tnNetworth, String tdNetworth, String tcDeviceinfo, Int32 tnUpdateKYC, Int32 tnUpdateaddress, Int32 tnUpadateFatca, Int32 tnUpdateMobile, Int32 tnUpdateemail, Int32 tnUpdateBank, Int32 tnUpdateDemat, String tcUserid, String tcFatherHusbandflag, String tpDocimageforAddress, String tpDocimageforKYC, String tpDocimageforFatca, String tcBankdetails, String tpDocimageforBank, String tcDematdetails, String tpDocimageforDemat, String tcOccupation, String tcEsigneddoneby, Int64& tnEkycDocumentno, String tcFilepath, String tcAddressasperKyc, Int64 tnEkycreferenceno, String tcUseraction, String tcIdentifier, String tcEsignPdffilename, String& tceSigndocumentid, Cliole loCCMcon, String tcEsignmethod, String tcEmailFamily, String tcEconfirmation, String tcMobilefamily, Int32 tnUpdateOtherdetails, String tdDOB, String tcAadharnumber, String tceducation, String tcInternettradingflag, String tcDPfees, String tcIBTdetails, String tcIPVproofdetails, String tcDepository, Int32 tnInternetsoftware, String tcKRAAddressIPV, Boolean tlEsignwithClientname, Int32 tnUpdatenominee, String tcNomineedetails, String tcNomineeproof, String tcClientSignaturefile, String tcNomineeopted, String tcNomineeoptout, Int32 tnUpdateSegment, String tcSegmentActivationdetails, String tcSegmentDeActivationdetails, String tcSegmentproofdetails, String tcSchemecode, String tcEsigncoordinator, String tcsubcategoryforcomm, String tcCommodiyitemlist, String tcDerConsentgiven) in File25:line 71242 Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 1012465664 Shut down : N Username : MOBBO Date/Time : 18/05/2024 1:07:54 PM Connection : Closed =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKH7990049Image180524014701.png$N$~ Message : UpdateEkycdata StackTrace : tpDocimageforBank Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 742699008 Shut down : N Username : MOBBO Date/Time : 18/05/2024 1:47:40 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKH7990049Image180524014701.png$N$ Message : UpdateEkycdata StackTrace : lcDocsrtring[i] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 742715392 Shut down : N Username : MOBBO Date/Time : 18/05/2024 1:47:40 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKH7990049Image180524014701.png Message : UpdateEkycdata StackTrace : lcProoffile[0] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 742715392 Shut down : N Username : MOBBO Date/Time : 18/05/2024 1:47:40 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKF7140044PDF180524022602.pdf$N$~ Message : UpdateEkycdata StackTrace : tpDocimageforBank Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 479203328 Shut down : N Username : MOBBO Date/Time : 18/05/2024 2:26:16 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKF7140044PDF180524022602.pdf$N$ Message : UpdateEkycdata StackTrace : lcDocsrtring[i] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 479219712 Shut down : N Username : MOBBO Date/Time : 18/05/2024 2:26:16 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKF7140044PDF180524022602.pdf Message : UpdateEkycdata StackTrace : lcProoffile[0] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 479219712 Shut down : N Username : MOBBO Date/Time : 18/05/2024 2:26:16 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Select tblFirmcreation.cshortname as cShortname From tblFirmcreation tblFirmcreation Where tblFirmcreation.cUserFirmcode='NBS-000001' Title : 01~Error Description : Value cannot be null. Parameter name: dataTable Method : AgeingacrossyearLine : 46316 Message : Ageingacrossyear StackTrace : at System.Data.Common.DataAdapter.Fill(DataTable[] dataTables, IDataReader dataReader, Int32 startRecord, Int32 maxRecords) at Oracle.ManagedDataAccess.Client.OracleDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable) at clientlevel.Thinclientlevel.Clientlogin.Ageingacrossyear(DateTime tdTransactiondate, Int32 tnTotaldays1, Int32 tnTotaldays2, Int32 tnTotaldays3, Int32 tnAngleselection, Int32 tnTotaldays4, Int32 tnTotaldays5, Int32 tnTotaldays6, Cliole loLdcommon, Int32 tnTotaldays7, Int32 tnTotaldays8, Int32 tnTotaldays9, Int32 tnTotaldays10, Int32 tnTotaldays11, Int32 tnTotaldays12, Int32 tnIncludepreviousyear, Int32 tnIgnorebounced, Int32 tnonlyReconciledentries, Int32 tnTerminalcodejoin, String& tcCashpayindate, String& tcFopayindate, Int32 tnAgeingonTransactiondate, String tcClientcode, Double tnAmount, String& tcSebiageingdate) in File25:line 46316 Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 646553600 Shut down : N Username : MOBBO Date/Time : 18/05/2024 2:40:10 PM Connection : Closed =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKSFS287Image180524024058.png$N$~ Message : UpdateEkycdata StackTrace : tpDocimageforBank Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 683393024 Shut down : N Username : MOBBO Date/Time : 18/05/2024 2:41:16 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKSFS287Image180524024058.png$N$ Message : UpdateEkycdata StackTrace : lcDocsrtring[i] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 683393024 Shut down : N Username : MOBBO Date/Time : 18/05/2024 2:41:16 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKSFS287Image180524024058.png Message : UpdateEkycdata StackTrace : lcProoffile[0] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 683393024 Shut down : N Username : MOBBO Date/Time : 18/05/2024 2:41:16 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKF9010017Image180524025256.png$N$~ Message : UpdateEkycdata StackTrace : tpDocimageforBank Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 352923648 Shut down : N Username : MOBBO Date/Time : 18/05/2024 2:53:21 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKF9010017Image180524025256.png$N$ Message : UpdateEkycdata StackTrace : lcDocsrtring[i] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 352940032 Shut down : N Username : MOBBO Date/Time : 18/05/2024 2:53:21 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKF9010017Image180524025256.png Message : UpdateEkycdata StackTrace : lcProoffile[0] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 352940032 Shut down : N Username : MOBBO Date/Time : 18/05/2024 2:53:21 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKF9010017Image180524030146.png$N$~ Message : UpdateEkycdata StackTrace : tpDocimageforBank Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 798523392 Shut down : N Username : MOBBO Date/Time : 18/05/2024 3:02:02 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKF9010017Image180524030146.png$N$ Message : UpdateEkycdata StackTrace : lcDocsrtring[i] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 798523392 Shut down : N Username : MOBBO Date/Time : 18/05/2024 3:02:02 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKF9010017Image180524030146.png Message : UpdateEkycdata StackTrace : lcProoffile[0] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 798523392 Shut down : N Username : MOBBO Date/Time : 18/05/2024 3:02:02 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKNIC012Image180524032141.png$N$~ Message : UpdateEkycdata StackTrace : tpDocimageforBank Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 613269504 Shut down : N Username : MOBBO Date/Time : 18/05/2024 3:21:53 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKNIC012Image180524032141.png$N$ Message : UpdateEkycdata StackTrace : lcDocsrtring[i] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 613285888 Shut down : N Username : MOBBO Date/Time : 18/05/2024 3:21:53 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKNIC012Image180524032141.png Message : UpdateEkycdata StackTrace : lcProoffile[0] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 613285888 Shut down : N Username : MOBBO Date/Time : 18/05/2024 3:21:53 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKH7960007Image180524044233.png$N$~ Message : UpdateEkycdata StackTrace : tpDocimageforBank Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 384471040 Shut down : N Username : MOBBO Date/Time : 18/05/2024 4:43:26 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKH7960007Image180524044233.png$N$ Message : UpdateEkycdata StackTrace : lcDocsrtring[i] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 384487424 Shut down : N Username : MOBBO Date/Time : 18/05/2024 4:43:26 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKH7960007Image180524044233.png Message : UpdateEkycdata StackTrace : lcProoffile[0] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 384487424 Shut down : N Username : MOBBO Date/Time : 18/05/2024 4:43:26 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKK0440128Image180524044816.png$N$~ Message : UpdateEkycdata StackTrace : tpDocimageforBank Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 624947200 Shut down : N Username : MOBBO Date/Time : 18/05/2024 4:48:30 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKK0440128Image180524044816.png$N$ Message : UpdateEkycdata StackTrace : lcDocsrtring[i] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 624971776 Shut down : N Username : MOBBO Date/Time : 18/05/2024 4:48:30 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Title : BANKK0440128Image180524044816.png Message : UpdateEkycdata StackTrace : lcProoffile[0] Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 624996352 Shut down : N Username : MOBBO Date/Time : 18/05/2024 4:48:30 PM Connection : Open =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Select tblFirmcreation.cshortname as cShortname From tblFirmcreation tblFirmcreation Where tblFirmcreation.cUserFirmcode='NBS-000001' Title : 01~Error Description : Value cannot be null. Parameter name: dataTable Method : AgeingacrossyearLine : 46316 Message : Ageingacrossyear StackTrace : at System.Data.Common.DataAdapter.Fill(DataTable[] dataTables, IDataReader dataReader, Int32 startRecord, Int32 maxRecords) at Oracle.ManagedDataAccess.Client.OracleDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable) at clientlevel.Thinclientlevel.Clientlogin.Ageingacrossyear(DateTime tdTransactiondate, Int32 tnTotaldays1, Int32 tnTotaldays2, Int32 tnTotaldays3, Int32 tnAngleselection, Int32 tnTotaldays4, Int32 tnTotaldays5, Int32 tnTotaldays6, Cliole loLdcommon, Int32 tnTotaldays7, Int32 tnTotaldays8, Int32 tnTotaldays9, Int32 tnTotaldays10, Int32 tnTotaldays11, Int32 tnTotaldays12, Int32 tnIncludepreviousyear, Int32 tnIgnorebounced, Int32 tnonlyReconciledentries, Int32 tnTerminalcodejoin, String& tcCashpayindate, String& tcFopayindate, Int32 tnAgeingonTransactiondate, String tcClientcode, Double tnAmount, String& tcSebiageingdate) in File25:line 46316 Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 625184768 Shut down : N Username : MOBBO Date/Time : 18/05/2024 5:12:04 PM Connection : Closed =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Select tblFirmcreation.cshortname as cShortname From tblFirmcreation tblFirmcreation Where tblFirmcreation.cUserFirmcode='NBS-000001' Title : 01~Error Description : Value cannot be null. Parameter name: dataTable Method : AgeingacrossyearLine : 46316 Message : Ageingacrossyear StackTrace : at System.Data.Common.DataAdapter.Fill(DataTable[] dataTables, IDataReader dataReader, Int32 startRecord, Int32 maxRecords) at Oracle.ManagedDataAccess.Client.OracleDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable) at clientlevel.Thinclientlevel.Clientlogin.Ageingacrossyear(DateTime tdTransactiondate, Int32 tnTotaldays1, Int32 tnTotaldays2, Int32 tnTotaldays3, Int32 tnAngleselection, Int32 tnTotaldays4, Int32 tnTotaldays5, Int32 tnTotaldays6, Cliole loLdcommon, Int32 tnTotaldays7, Int32 tnTotaldays8, Int32 tnTotaldays9, Int32 tnTotaldays10, Int32 tnTotaldays11, Int32 tnTotaldays12, Int32 tnIncludepreviousyear, Int32 tnIgnorebounced, Int32 tnonlyReconciledentries, Int32 tnTerminalcodejoin, String& tcCashpayindate, String& tcFopayindate, Int32 tnAgeingonTransactiondate, String tcClientcode, Double tnAmount, String& tcSebiageingdate) in File25:line 46316 Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 625250304 Shut down : N Username : MOBBO Date/Time : 18/05/2024 5:12:10 PM Connection : Closed =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Select tblFirmcreation.cshortname as cShortname From tblFirmcreation tblFirmcreation Where tblFirmcreation.cUserFirmcode='NBS-000001' Title : 01~Error Description : Value cannot be null. Parameter name: dataTable Method : AgeingacrossyearLine : 46316 Message : Ageingacrossyear StackTrace : at System.Data.Common.DataAdapter.Fill(DataTable[] dataTables, IDataReader dataReader, Int32 startRecord, Int32 maxRecords) at Oracle.ManagedDataAccess.Client.OracleDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable) at clientlevel.Thinclientlevel.Clientlogin.Ageingacrossyear(DateTime tdTransactiondate, Int32 tnTotaldays1, Int32 tnTotaldays2, Int32 tnTotaldays3, Int32 tnAngleselection, Int32 tnTotaldays4, Int32 tnTotaldays5, Int32 tnTotaldays6, Cliole loLdcommon, Int32 tnTotaldays7, Int32 tnTotaldays8, Int32 tnTotaldays9, Int32 tnTotaldays10, Int32 tnTotaldays11, Int32 tnTotaldays12, Int32 tnIncludepreviousyear, Int32 tnIgnorebounced, Int32 tnonlyReconciledentries, Int32 tnTerminalcodejoin, String& tcCashpayindate, String& tcFopayindate, Int32 tnAgeingonTransactiondate, String tcClientcode, Double tnAmount, String& tcSebiageingdate) in File25:line 46316 Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 739909632 Shut down : N Username : MOBBO Date/Time : 18/05/2024 5:58:37 PM Connection : Closed =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Select tblFirmcreation.cshortname as cShortname From tblFirmcreation tblFirmcreation Where tblFirmcreation.cUserFirmcode='NBS-000001' Title : 01~Error Description : Value cannot be null. Parameter name: dataTable Method : AgeingacrossyearLine : 46316 Message : Ageingacrossyear StackTrace : at System.Data.Common.DataAdapter.Fill(DataTable[] dataTables, IDataReader dataReader, Int32 startRecord, Int32 maxRecords) at Oracle.ManagedDataAccess.Client.OracleDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable) at clientlevel.Thinclientlevel.Clientlogin.Ageingacrossyear(DateTime tdTransactiondate, Int32 tnTotaldays1, Int32 tnTotaldays2, Int32 tnTotaldays3, Int32 tnAngleselection, Int32 tnTotaldays4, Int32 tnTotaldays5, Int32 tnTotaldays6, Cliole loLdcommon, Int32 tnTotaldays7, Int32 tnTotaldays8, Int32 tnTotaldays9, Int32 tnTotaldays10, Int32 tnTotaldays11, Int32 tnTotaldays12, Int32 tnIncludepreviousyear, Int32 tnIgnorebounced, Int32 tnonlyReconciledentries, Int32 tnTerminalcodejoin, String& tcCashpayindate, String& tcFopayindate, Int32 tnAgeingonTransactiondate, String tcClientcode, Double tnAmount, String& tcSebiageingdate) in File25:line 46316 Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 330899456 Shut down : N Username : MOBBO Date/Time : 18/05/2024 7:13:46 PM Connection : Closed =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Select tblFirmcreation.cshortname as cShortname From tblFirmcreation tblFirmcreation Where tblFirmcreation.cUserFirmcode='NBS-000001' Title : 01~Error Description : Value cannot be null. Parameter name: dataTable Method : AgeingacrossyearLine : 46316 Message : Ageingacrossyear StackTrace : at System.Data.Common.DataAdapter.Fill(DataTable[] dataTables, IDataReader dataReader, Int32 startRecord, Int32 maxRecords) at Oracle.ManagedDataAccess.Client.OracleDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable) at clientlevel.Thinclientlevel.Clientlogin.Ageingacrossyear(DateTime tdTransactiondate, Int32 tnTotaldays1, Int32 tnTotaldays2, Int32 tnTotaldays3, Int32 tnAngleselection, Int32 tnTotaldays4, Int32 tnTotaldays5, Int32 tnTotaldays6, Cliole loLdcommon, Int32 tnTotaldays7, Int32 tnTotaldays8, Int32 tnTotaldays9, Int32 tnTotaldays10, Int32 tnTotaldays11, Int32 tnTotaldays12, Int32 tnIncludepreviousyear, Int32 tnIgnorebounced, Int32 tnonlyReconciledentries, Int32 tnTerminalcodejoin, String& tcCashpayindate, String& tcFopayindate, Int32 tnAgeingonTransactiondate, String tcClientcode, Double tnAmount, String& tcSebiageingdate) in File25:line 46316 Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 332582912 Shut down : N Username : MOBBO Date/Time : 18/05/2024 10:24:46 PM Connection : Closed =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Select tblFirmcreation.cshortname as cShortname From tblFirmcreation tblFirmcreation Where tblFirmcreation.cUserFirmcode='NBS-000001' Title : 01~Error Description : Value cannot be null. Parameter name: dataTable Method : AgeingacrossyearLine : 46316 Message : Ageingacrossyear StackTrace : at System.Data.Common.DataAdapter.Fill(DataTable[] dataTables, IDataReader dataReader, Int32 startRecord, Int32 maxRecords) at Oracle.ManagedDataAccess.Client.OracleDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable) at clientlevel.Thinclientlevel.Clientlogin.Ageingacrossyear(DateTime tdTransactiondate, Int32 tnTotaldays1, Int32 tnTotaldays2, Int32 tnTotaldays3, Int32 tnAngleselection, Int32 tnTotaldays4, Int32 tnTotaldays5, Int32 tnTotaldays6, Cliole loLdcommon, Int32 tnTotaldays7, Int32 tnTotaldays8, Int32 tnTotaldays9, Int32 tnTotaldays10, Int32 tnTotaldays11, Int32 tnTotaldays12, Int32 tnIncludepreviousyear, Int32 tnIgnorebounced, Int32 tnonlyReconciledentries, Int32 tnTerminalcodejoin, String& tcCashpayindate, String& tcFopayindate, Int32 tnAgeingonTransactiondate, String tcClientcode, Double tnAmount, String& tcSebiageingdate) in File25:line 46316 Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 332607488 Shut down : N Username : MOBBO Date/Time : 18/05/2024 10:24:53 PM Connection : Closed =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Select tblFirmcreation.cshortname as cShortname From tblFirmcreation tblFirmcreation Where tblFirmcreation.cUserFirmcode='NBS-000001' Title : 01~Error Description : Value cannot be null. Parameter name: dataTable Method : AgeingacrossyearLine : 46316 Message : Ageingacrossyear StackTrace : at System.Data.Common.DataAdapter.Fill(DataTable[] dataTables, IDataReader dataReader, Int32 startRecord, Int32 maxRecords) at Oracle.ManagedDataAccess.Client.OracleDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable) at clientlevel.Thinclientlevel.Clientlogin.Ageingacrossyear(DateTime tdTransactiondate, Int32 tnTotaldays1, Int32 tnTotaldays2, Int32 tnTotaldays3, Int32 tnAngleselection, Int32 tnTotaldays4, Int32 tnTotaldays5, Int32 tnTotaldays6, Cliole loLdcommon, Int32 tnTotaldays7, Int32 tnTotaldays8, Int32 tnTotaldays9, Int32 tnTotaldays10, Int32 tnTotaldays11, Int32 tnTotaldays12, Int32 tnIncludepreviousyear, Int32 tnIgnorebounced, Int32 tnonlyReconciledentries, Int32 tnTerminalcodejoin, String& tcCashpayindate, String& tcFopayindate, Int32 tnAgeingonTransactiondate, String tcClientcode, Double tnAmount, String& tcSebiageingdate) in File25:line 46316 Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 399876096 Shut down : N Username : MOBBO Date/Time : 19/05/2024 1:14:55 AM Connection : Closed =========================================================================================== $-------------------------------------- Begin ---------------------------------------------$ Client code : Select tblFirmcreation.cshortname as cShortname From tblFirmcreation tblFirmcreation Where tblFirmcreation.cUserFirmcode='NBS-000001' Title : 01~Error Description : Value cannot be null. Parameter name: dataTable Method : AgeingacrossyearLine : 46316 Message : Ageingacrossyear StackTrace : at System.Data.Common.DataAdapter.Fill(DataTable[] dataTables, IDataReader dataReader, Int32 startRecord, Int32 maxRecords) at Oracle.ManagedDataAccess.Client.OracleDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable) at clientlevel.Thinclientlevel.Clientlogin.Ageingacrossyear(DateTime tdTransactiondate, Int32 tnTotaldays1, Int32 tnTotaldays2, Int32 tnTotaldays3, Int32 tnAngleselection, Int32 tnTotaldays4, Int32 tnTotaldays5, Int32 tnTotaldays6, Cliole loLdcommon, Int32 tnTotaldays7, Int32 tnTotaldays8, Int32 tnTotaldays9, Int32 tnTotaldays10, Int32 tnTotaldays11, Int32 tnTotaldays12, Int32 tnIncludepreviousyear, Int32 tnIgnorebounced, Int32 tnonlyReconciledentries, Int32 tnTerminalcodejoin, String& tcCashpayindate, String& tcFopayindate, Int32 tnAgeingonTransactiondate, String tcClientcode, Double tnAmount, String& tcSebiageingdate) in File25:line 46316 Computer : LDBRANCH1 Processor : 12 OS Version : Microsoft Windows NT 6.3.9600.0 Memory : 369045504 Shut down : N Username : MOBBO Date/Time : 19/05/2024 4:10:37 AM Connection : Closed ===========================================================================================