Zeit_verk_Std.sql 2.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. select T1."order_number" as "Order Number",
  2. T1."order_position" as "Order Position",
  3. T1."labour_type" as "Labour Type",
  4. T2."code" as "Code_Labour_Types",
  5. T2."description" as "Description_Labour_Types",
  6. T3."order_number" as "Order Number_Labours",
  7. T3."order_position" as "Order Position_Labours",
  8. T3."order_position_line" as "Order Position Line_Labours",
  9. '0' + (rtrim((convert(varchar(50), T4."subsidiary")))) as "Subsidiary_Labours",
  10. T3."is_invoiced" as "Is Invoiced_Labours",
  11. T3."invoice_type" as "Invoice Type_Labours",
  12. T3."invoice_number" as "Invoice Number_Labours",
  13. T3."employee_no" as "Employee No_Labours",
  14. T3."mechanic_no" as "Mechanic No_Labours",
  15. T3."labour_operation_id" as "Labour Operation Id_Labours",
  16. T3."is_nominal" as "Is Nominal_Labours",
  17. T3."net_price_in_order" as "Net Price In Order_Labours",
  18. T3."rebate_percent" as "Rebate Percent_Labours",
  19. T3."goodwill_percent" as "Goodwill Percent_Labours",
  20. T3."charge_type" as "Charge Type_Labours",
  21. T3."text_line" as "Text Line_Labours",
  22. 10 as "AW/Std.",
  23. ((convert(float, T3."time_units"))) / 10 as "verk. Std.",
  24. 'verk. Std.' as "Zeitkategorie",
  25. '' as "Zeitkategorie2",
  26. T4."employee_number" as "Employee Number_Employee",
  27. T4."name" as "Name_Employee",
  28. (rtrim((convert(varchar(50), T4."employee_number")))) + ' - ' + T4."name" as "Monteur",
  29. T5."invoice_number" as "Invoice Number_Invoices",
  30. T5."invoice_date" as "Invoice Date_Invoices",
  31. T5."invoice_date" as "Datum",
  32. T3."time_units" as "Time Units_Labours",
  33. (convert(float, T3."time_units")) as "Time_Units_Zahl"
  34. from ("dbo"."invoices" T5 left outer join ((("dbo"."order_positions" T1 left outer join "dbo"."labour_types" T2 on T1."labour_type" = T2."code") left outer join "dbo"."labours" T3 on T1."order_number" = T3."order_number") left outer join "dbo"."employees" T4 on T3."mechanic_no" = T4."employee_number") on (T3."invoice_number" = T5."invoice_number") and (T3."invoice_type" = T5."invoice_type"))
  35. where (((convert(float, T3."time_units"))) <> 0)
  36. -- order by "Order Number" asc,"Order Position" asc