Workshop

ini jika cuma dikasih plat nomor select reference_number,created_at,is_order_development, CASE WHEN is_complete=0 and is_delivered_to_mechanic=0 THEN 'Dashboard FO belum dikirm ke mekanik' WHEN is_complete=0 and is_delivered_to_mechanic=1 and mechanic_acceptment_time is null THEN 'dashboard mekanik belum di accept' when is_complete=0 and mechanic_acceptment_time is not null then 'DI Progress Mekanik belum selesai' when is_complete=1 and (select srv_invoice_id from srv_invoices where bill_of_service_id=bill_of_service) is null then 'Sudah selesai, belum jadi inv' when is_complete=1 and (select srv_invoice_id from srv_invoices where bill_of_service_id=bill_of_service) is not null then 'Sudah selesai, jadi inv' ELSE 'hubungi aufal' END as status from srv_work_order_letters where quotation_id in ( select srv_quotation_id from srv_quotations where cust_vehicle_id in( select srv_customer_vehicle_id from srv_customer_vehicles where replace(vehicle_plate_license,' ','') = replace('H 9366 NZ',' ',''))) ------------------------------------------------------------------------------------------------------------------------------------------- ini jika dikasih no spk select reference_number,created_at,is_order_development, CASE WHEN is_complete=0 and is_delivered_to_mechanic=0 THEN 'Dashboard FO belum dikirm ke mekanik' WHEN is_complete=0 and is_delivered_to_mechanic=1 and mechanic_acceptment_time is null THEN 'dashboard mekanik belum di accept' when is_complete=0 and mechanic_acceptment_time is not null then 'DI Progress Mekanik belum selesai' when is_complete=1 and (select srv_invoice_id from srv_invoices where bill_of_service_id=bill_of_service) is null then 'Sudah selesai, belum jadi inv' when is_complete=1 and (select srv_invoice_id from srv_invoices where bill_of_service_id=bill_of_service) is not null then 'Sudah selesai, jadi inv' ELSE 'hubungi aufal' END as status from srv_work_order_letters where reference_number like '%1400518000885SPK%' ______________________________________________________________________________________________________________________ ini jika mau ambil semua spk di cabang pada satu hari select w.reference_number,w.created_at,w.is_order_development,c.name, CASE WHEN is_complete=0 and is_delivered_to_mechanic=0 THEN 'Dashboard FO belum dikirm ke mekanik' WHEN is_complete=0 and is_delivered_to_mechanic=1 and mechanic_acceptment_time is null THEN 'dashboard mekanik belum di accept' when is_complete=0 and mechanic_acceptment_time is not null then 'DI Progress Mekanik belum selesai' when is_complete=1 and (select srv_invoice_id from srv_invoices where bill_of_service_id=bill_of_service) is null then 'Sudah selesai, belum jadi inv' when is_complete=1 and (select srv_invoice_id from srv_invoices where bill_of_service_id=bill_of_service) is not null then 'Sudah selesai, jadi inv' ELSE 'hubungi aufal' END as status from srv_work_order_letters w join companies c on w.company_id=c.company_id where c.company_id=9 and w.created_at::date='2018-11-03' ------------------------------------------------------------------------------------------------------------------------------------------- ini jika mau ambil semua spk di cabang pada tanggal tertentu select w.reference_number,w.created_at,w.is_order_development,c.name, CASE WHEN is_complete=0 and is_delivered_to_mechanic=0 THEN 'Dashboard FO belum dikirm ke mekanik' WHEN is_complete=0 and is_delivered_to_mechanic=1 and mechanic_acceptment_time is null THEN 'dashboard mekanik belum di accept' when is_complete=0 and mechanic_acceptment_time is not null then 'DI Progress Mekanik belum selesai' when is_complete=1 and (select srv_invoice_id from srv_invoices where bill_of_service_id=bill_of_service) is null then 'Sudah selesai, belum jadi inv' when is_complete=1 and (select srv_invoice_id from srv_invoices where bill_of_service_id=bill_of_service) is not null then 'Sudah selesai, jadi inv' ELSE 'hubungi aufal' END as status from srv_work_order_letters w join companies c on w.company_id=c.company_id where c.company_id=9 and w.created_at::date between '2018-11-03' and '2018-11-04' _______________________________________________________________________________________________________________________________
Query Umum

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.