Advertisement
aadddrr

Update Pajak KPS-577

Jan 2nd, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. UPDATE fi_invoice_ar_balance Z
  2.     SET amount = Z.amount + A.amount
  3.     FROM fi_invoice_ar_balance A
  4.     WHERE Z.invoice_ar_id = 43577
  5.         AND A.invoice_ar_id = 43576
  6.  
  7.     UPDATE fi_invoice_ar_balance
  8.     SET amount = 0
  9.     WHERE invoice_ar_id = 43576
  10.  
  11.     UPDATE fi_invoice_tax_ar_balance  Z
  12.     SET tax_amount = Z.amount + A.amount
  13.         gov_tax_amount = Z.gov_tax_amount + A.gov_tax_amount
  14.         gov_base_amount = Z.gov_base_amount + A.gov_base_amount
  15.     FROM fi_invoice_tax_ar_balance A
  16.     WHERE Z.invoice_ar_balance_id = 36886
  17.         AND A.invoice_ar_balance_id = 36885
  18.  
  19.     UPDATE fi_invoice_tax_ar_balance
  20.     SET tax_amount = 0
  21.         gov_tax_amount = 0
  22.         gov_base_amount = 0
  23.     WHERE invoice_ar_balance_id = 36885
  24.  
  25.     UPDATE fi_vat_out_for_reporting Z
  26.     SET base_amount = Z.base_amount + A.base_amount
  27.         vat_amount = Z.vat_amount + A.vat_amount
  28.     FROM fi_vat_out_for_reporting A
  29.     WHERE Z.ref_id = 2484
  30.         AND A.ref_id = 2483
  31.  
  32.     UPDATE fi_vat_out_for_reporting
  33.     SET base_amount = 0
  34.         vat_amount = 0
  35.     FROM fi_vat_out_for_reporting
  36.     WHERE ref_id = 2483
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement