Upload Ezybill_queries_alpaca_format_no_main.json
Browse files
Ezybill_queries_alpaca_format_no_main.json
ADDED
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
[
|
2 |
+
{
|
3 |
+
"instruction": "To find the due amount for a specific customer with account_number",
|
4 |
+
"input": "$account_number",
|
5 |
+
"output": "SELECT \n(COALESCE(ce.customer_due,0)) due_amount\nFROM customer c\nINNER JOIN eb_customer_extension ce ON ce.customer_id=c.customer_id \nwhere c.account_number='$account_number' AND c.dealer_id = 1;"
|
6 |
+
},
|
7 |
+
{
|
8 |
+
"instruction": "To find the payment details for a specific customer with account_number",
|
9 |
+
"input": "$account_number",
|
10 |
+
"output": "SELECT p.paid_on, p.payment_mode, p.paid_amount, p.receipt_no\nFROM acc_payment_details p\nINNER JOIN customer c ON p.customer_id = c.customer_id\nWHERE p.dealer_id = 1 AND c.account_number = '$account_number'\nORDER BY p.paid_on DESC;"
|
11 |
+
},
|
12 |
+
{
|
13 |
+
"instruction": "To find the Customer services details for a specific customer with account_number",
|
14 |
+
"input": "$account_number",
|
15 |
+
"output": "SELECT COALESCE( c.first_name, '' ) first_name, COALESCE( c.last_name, '' ) last_name,cs.service_start_date,cs.service_end_date,\nCASE WHEN cs.status=1 THEN 'Active' ELSE 'Deactive' END as Status,p.pname,s.serial_number,bs.display_name\nFROM customer c\nINNER JOIN customer_device cd ON cd.customer_id = c.customer_id AND cd.device_closed_on IS NULL\nINNER JOIN eb_stock s ON s.serial_number = cd.box_number\nINNER JOIN backend_setups bs ON bs.backend_setup_id = s.backend_setup_id \nINNER JOIN eb_customer_service cs ON cs.stock_id_v2 = s.stock_id \nINNER JOIN eb_products p ON cs.product_id_v2 = p.product_id AND p.plugin_id = 4\nLEFT JOIN eb_customer_service cs1 ON cs1.customer_service_id = cs.parent_service_id and cs1.plugin_id = 4\nINNER JOIN employee e ON e.employee_id = cs.created_by\nWHERE c.account_number = '$account_number'\nand (case when cs.parent_service_id=0 then cs.status=1 when cs.parent_service_id>0 then cs1.status = 1 \nelse (cs.status=1 OR cs.status = 0) end) \nAND c.dealer_id =1\nORDER BY s.serial_number,cs1.customer_service_id,cs.status DESC"
|
16 |
+
},
|
17 |
+
{
|
18 |
+
"instruction": "To find the employee deposit amount for a specific employee with dist_subdist_lcocode",
|
19 |
+
"input": "$dist_subdist_lcocode",
|
20 |
+
"output": "SELECT deposit_amount FROM employee WHERE dist_subdist_lcocode='$dist_subdist_lcocode' AND dealer_id=1"
|
21 |
+
},
|
22 |
+
{
|
23 |
+
"instruction": "To find the total customer's under specific employee (LCO) with dist_subdist_lcocode",
|
24 |
+
"input": "$dist_subdist_lcocode",
|
25 |
+
"output": "SELECT count(distinct s.customer_id_v2) total_active_customers\nFROM eb_stock s\nINNER JOIN backend_setups bs on bs.backend_setup_id = s.backend_setup_id and bs.setup_for=5\nINNER JOIN customer_group cg ON cg.customer_id=s.customer_id_v2\nINNER JOIN employee e ON e.employee_id=s.reseller_v2\nWHERE s.status=1 AND s.dealer_id=1 AND s.is_trash=0 AND e.dist_subdist_lcocode='$dist_subdist_lcocode' AND s.customer_id_v2>0\n"
|
26 |
+
},
|
27 |
+
{
|
28 |
+
"instruction": "To find the total active customer's under Mso",
|
29 |
+
"input": "",
|
30 |
+
"output": "SELECT count(distinct s.customer_id_v2) total_active_customers\nFROM eb_stock s\nINNER JOIN backend_setups bs on bs.backend_setup_id = s.backend_setup_id and bs.setup_for=5\nINNER JOIN customer_group cg ON cg.customer_id=s.customer_id_v2\nWHERE s.status=1 AND s.dealer_id=1 AND s.is_trash=0 AND s.customer_id_v2>0"
|
31 |
+
},
|
32 |
+
{
|
33 |
+
"instruction": "To find the total deactive customer's under MSO",
|
34 |
+
"input": "",
|
35 |
+
"output": "SELECT count(distinct s.customer_id_v2) total_deactive_customers\nFROM eb_stock s\nINNER JOIN backend_setups bs on bs.backend_setup_id = s.backend_setup_id \nWHERE s.status=2 AND s.dealer_id=1 AND s.is_trash=0 AND s.customer_id_v2>0\n AND s.customer_id_v2 not in( \nSELECT s.customer_id_v2 FROM eb_stock s \nINNER JOIN backend_setups bs on bs.backend_setup_id = s.backend_setup_id \nWHERE s.status=1 AND s.dealer_id=1 AND s.is_trash=0 AND s.customer_id_v2>0)"
|
36 |
+
},
|
37 |
+
{
|
38 |
+
"instruction": "To find the total active stb count under MSO",
|
39 |
+
"input": "",
|
40 |
+
"output": "select COUNT(DISTINCT s.stock_id) count_active \nFROM eb_stock s \nINNER JOIN eb_stock_location esl ON esl.location_id=s.stock_location \nINNER JOIN backend_setups bs ON s.backend_setup_id=bs.backend_setup_id AND bs.setup_for=5 \nWHERE s.status=1 and s.is_trash=0 AND s.dealer_id=1"
|
41 |
+
},
|
42 |
+
{
|
43 |
+
"instruction": "To find the total deactive stb count under MSO",
|
44 |
+
"input": "",
|
45 |
+
"output": "select COUNT(DISTINCT s.stock_id) count_deactive \nFROM eb_stock s \nINNER JOIN eb_stock_location esl ON esl.location_id=s.stock_location \nINNER JOIN backend_setups bs ON s.backend_setup_id=bs.backend_setup_id AND bs.setup_for=5 \nWHERE s.status=2 and s.is_trash=0 AND s.dealer_id=1"
|
46 |
+
},
|
47 |
+
{
|
48 |
+
"instruction": "To get the cusrrent month billling under MSO with $bill_month ",
|
49 |
+
"input": "$bill_month ",
|
50 |
+
"output": "select sum(x.total_current_month_bill) as current_month_total_amount \nfrom(select coalesce(sum(ab.total_amount ) ,'0.00') total_current_month_bill \n from acc_billing ab WHERE ab.dealer_id = 1 AND ab.bill_month = '$bill_month' \nUNION ALL \nselect SUM( adj.total_bill_adj * -1 ) as total_current_month_bill \nfrom customer_billing_adjustment adj \nINNER JOIN acc_billing b on b.billing_id = adj.billing_id and b.bill_month = '$bill_month' \nWHERE adj.dealer_id = 1) x"
|
51 |
+
}
|
52 |
+
]
|