xtract.journal_accountings.sql 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. SET QUOTED_IDENTIFIER ON
  2. GO
  3. SET ANSI_NULLS ON
  4. GO
  5. CREATE VIEW [xtract].[journal_accountings] AS
  6. SELECT [client_db]
  7. , [subsidiary_to_company_ref]
  8. , [accounting_date]
  9. , [document_type]
  10. , [document_number]
  11. , [position_in_document]
  12. , [customer_number]
  13. , [nominal_account_number]
  14. -- , [is_balanced]
  15. , [clearing_number]
  16. , [document_date]
  17. , [posted_value]
  18. , [debit_or_credit]
  19. , [posted_count]
  20. , [branch_number]
  21. -- , [customer_contra_account]
  22. -- , [nominal_contra_account]
  23. -- , [contra_account_text]
  24. -- , [account_form_page_number]
  25. -- , [account_form_page_line]
  26. -- , [serial_number_each_month]
  27. , [employee_number]
  28. , [invoice_date]
  29. , [invoice_number]
  30. , [dunning_level]
  31. -- , [last_dunning_date]
  32. -- , [journal_page]
  33. -- , [journal_line]
  34. -- , [cash_discount]
  35. -- , [term_of_payment]
  36. , [posting_text]
  37. , [vehicle_reference]
  38. -- , [vat_id_number]
  39. -- , [account_statement_number]
  40. -- , [account_statement_page]
  41. -- , [vat_key]
  42. -- , [days_for_cash_discount]
  43. -- , [day_of_actual_accounting]
  44. , [skr51_branch]
  45. , [skr51_make]
  46. , [skr51_cost_center]
  47. , [skr51_sales_channel]
  48. , [skr51_cost_unit]
  49. -- , [previously_used_account_no]
  50. -- , [free_form_accounting_text]
  51. -- , [free_form_document_text]
  52. , "posted_value" * iif(("debit_or_credit" = 'H'), -1, 1) / 100 AS "Betrag"
  53. , "posted_count" * iif(("debit_or_credit" = 'H'), -1, 1) / 100 AS "Menge"
  54. FROM [LOCOSOFT].[dbo].[journal_accountings]
  55. GO
  56. SET QUOTED_IDENTIFIER OFF
  57. GO
  58. SET ANSI_NULLS OFF
  59. GO
  60. GO