[json] RIA

Viewer

  1. InstapayReconciliation:
  2.         {
  3.                 fields: [
  4.                         "order_number",
  5.                         "order_date ",
  6.                         "customer ",
  7.                         "currency_from",
  8.                         "amount_sent",
  9.                         "tax",
  10.                         "total",
  11.                         "comm",
  12.                         "vendor_txn_id",
  13.                         "customer_transaction_amount ",
  14.                         "FORMAT_DATETIME('%d-%m-%Y', DATETIME(created_at, 'Asia/Kuala_Lumpur')) as CreatedAt",
  15.                         "recon_flag as ReconFlag",
  16.                 ],
  17.                 filter:
  18.                 {},
  19.                 whereClause: "and recon_flag !='present_in_both'",
  20.                 orderBy: "created_at desc",
  21.                 timestampColumn: "created_at",
  22.                 table: "master_recon",
  23.         },
  24.  
  25.         InstapayRiaDebitAmount:
  26.         {
  27.                 fields: "round(sum(amount),2) AS Debit",
  28.                 whereClause: "AND source_channel = 'ria' and source_type = 'regular' and source_transaction_type = 'debit' and recon_flag IN ('present_in_ria','present_in_both')",
  29.                 timestampColumn: "created_at",
  30.                 table: `master_recon`,
  31.         },
  32.         InstapayRiaReversalAmount:
  33.         {
  34.                 fields: "round(sum(amount),2) AS Reversal",
  35.                 whereClause: "AND source_channel = 'ria' and source_type = 'regular' and source_transaction_type = 'reversal' and recon_flag IN ('present_in_ria','present_in_both')",
  36.                 timestampColumn: "created_at",
  37.                 table: `master_recon`,
  38.         },
  39.         InstapayRiaTotalAmount:
  40.         {
  41.                 fields: "round(sum(amount),2) AS Total",
  42.                 whereClause: "AND source_channel = 'ria' and source_type = 'regular' and source_transaction_type in ('debit', 'reversal') and recon_flag IN ('present_in_ria','present_in_both')",
  43.                 timestampColumn: "created_at",
  44.                 table: `master_recon`,
  45.         },
  46.         InstapayRiaDebitYSEAmount:
  47.         {
  48.                 fields: "round(sum(amount),2) AS DebitYSE",
  49.                 whereClause: "AND source_channel = 'ria' and source_type = 'yse' and source_transaction_type = 'debit' and recon_flag='remittance_debit'",
  50.                 timestampColumn: "created_at",
  51.                 table: `master_recon`,
  52.         },
  53.         InstapayRiaReversalYSEAmount:
  54.         {
  55.                 fields: "round(sum(amount),2) AS ReversalYSE",
  56.                 whereClause: "AND source_channel = 'ria' and source_type = 'yse' and source_transaction_type = 'reversal' and recon_flag='remittance_reversal'",
  57.                 timestampColumn: "created_at",
  58.                 table: `master_recon`,
  59.         },
  60.         InstapayRiaTotalYSEAmount:
  61.         {
  62.                 fields: "round(sum(amount),2) AS Total",
  63.                 whereClause: "AND source_channel = 'ria' and source_type = 'yse' and recon_flag in ('remittance_debit', 'remittance_reversal')",
  64.                 timestampColumn: "created_at",
  65.                 table: `master_recon`,
  66.         },
  67.         InstapayRiaDebitVarianceAmount:
  68.         {
  69.                 fields: "round(SUM(case when recon_flag IN ('present_in_ria','present_in_both') then (CASE WHEN total < 0 THEN total ELSE 0 END) when recon_flag = 'remittance_debit' then -1*ifnull(account_amount,0) end), 2) as Variance",
  70.                 whereClause: "AND recon_flag IN ('remittance_debit', 'present_in_ria','present_in_both') AND source_channel = 'ria'",
  71.                 timestampColumn: "created_at",
  72.                 table: `master_recon`,
  73.         },
  74.         InstapayRiaReversalVarianceAmount:
  75.         {
  76.                 fields: "round(SUM(case when recon_flag IN ('present_in_ria','present_in_both') then (CASE WHEN total > 0 THEN total ELSE 0 END) when recon_flag = 'remittance_reversal' then -1*ifnull(account_amount,0) end), 2) as Variance",
  77.                 whereClause: "AND recon_flag IN ('remittance_reversal', 'present_in_ria','present_in_both') AND source_channel = 'ria'",
  78.                 timestampColumn: "created_at",
  79.                 table: `master_recon`,
  80.         },
  81.         InstapayRiaTotalVarianceAmount:
  82.         {
  83.                 fields: "round(SUM(case when recon_flag IN ('present_in_ria','present_in_both') then total when recon_flag in ('remittance_reversal', 'remittance_debit') then -1*ifnull(account_amount,0) end), 2) as Variance",
  84.                 whereClause: "AND recon_flag IN ('remittance_debit', 'remittance_reversal', 'present_in_ria','present_in_both') AND source_channel = 'ria'",
  85.                 timestampColumn: "created_at",
  86.                 table: `master_recon`,
  87.         },

Editor

You can edit this paste and save as new:


File Description
  • RIA
  • Paste Code
  • 24 Apr-2024
  • 3.61 Kb
You can Share it: