Prepare request: 0000 00 00 00 00 00 00 00 00 00 00 00 00 08 00 45 00 ..............E. 0010 05 98 d0 79 40 00 40 06 66 e4 7f 00 00 01 7f 00 ...y@.@.f....... 0020 00 01 a8 44 0c ea a3 9c 49 4b 42 b9 96 22 80 18 ...D....IKB..".. 0030 02 00 03 8d 00 00 01 01 08 0a bb ae dd e2 bb ae ................ 0040 dd ae 60 05 00 00 16 73 65 6c 65 63 74 20 60 52 ..`....select `R 0050 65 63 65 69 70 74 60 2e 60 6f 75 74 6c 65 74 49 eceipt`.`outletI 0060 64 60 2c 20 60 52 65 63 65 69 70 74 50 61 79 6d d`, `ReceiptPaym 0070 65 6e 74 60 2e 60 70 61 79 6d 65 6e 74 54 79 70 ent`.`paymentTyp 0080 65 49 64 60 2c 20 60 50 61 79 6d 65 6e 74 54 79 eId`, `PaymentTy 0090 70 65 60 2e 60 6d 65 74 68 6f 64 60 2c 20 64 61 pe`.`method`, da 00a0 74 65 5f 66 6f 72 6d 61 74 28 60 52 65 63 65 69 te_format(`Recei 00b0 70 74 60 2e 60 54 53 43 63 72 65 61 74 65 64 60 pt`.`TSCcreated` 00c0 2c 20 27 25 59 2d 25 6d 2d 25 64 20 25 48 3a 30 , '%Y-%m-%d %H:0 00d0 30 3a 30 30 27 29 20 61 73 20 60 48 6f 75 72 53 0:00') as `HourS 00e0 74 61 72 74 54 69 6d 65 60 2c 20 73 75 6d 28 63 tartTime`, sum(c 00f0 61 73 65 20 77 68 65 6e 20 60 52 65 63 65 69 70 ase when `Receip 0100 74 60 2e 60 74 79 70 65 60 20 3d 20 3f 20 74 68 t`.`type` = ? th 0110 65 6e 20 3f 20 65 6c 73 65 20 3f 20 65 6e 64 29 en ? else ? end) 0120 20 61 73 20 60 54 72 61 6e 73 61 63 74 69 6f 6e as `Transaction 0130 73 60 2c 20 63 61 73 74 28 73 75 6d 28 63 61 73 s`, cast(sum(cas 0140 65 20 77 68 65 6e 20 60 52 65 63 65 69 70 74 60 e when `Receipt` 0150 2e 60 74 79 70 65 60 20 3d 20 3f 20 74 68 65 6e .`type` = ? then 0160 20 63 61 73 74 28 69 66 6e 75 6c 6c 28 60 52 65 cast(ifnull(`Re 0170 63 65 69 70 74 50 61 79 6d 65 6e 74 60 2e 60 70 ceiptPayment`.`p 0180 61 79 6d 65 6e 74 54 6f 74 61 6c 60 2c 20 3f 29 aymentTotal`, ?) 0190 20 61 73 20 73 69 67 6e 65 64 29 20 65 6c 73 65 as signed) else 01a0 20 3f 20 65 6e 64 29 20 61 73 20 73 69 67 6e 65 ? end) as signe 01b0 64 29 20 61 73 20 60 70 61 79 6d 65 6e 74 41 6d d) as `paymentAm 01c0 6f 75 6e 74 60 2c 20 73 75 6d 28 63 61 73 65 20 ount`, sum(case 01d0 77 68 65 6e 20 60 52 65 63 65 69 70 74 60 2e 60 when `Receipt`.` 01e0 74 79 70 65 60 20 3d 20 3f 20 74 68 65 6e 20 3f type` = ? then ? 01f0 20 65 6c 73 65 20 3f 20 65 6e 64 29 20 61 73 20 else ? end) as 0200 60 72 65 66 75 6e 64 54 72 61 6e 73 61 63 74 69 `refundTransacti 0210 6f 6e 73 60 2c 20 63 61 73 74 28 73 75 6d 28 63 ons`, cast(sum(c 0220 61 73 65 20 77 68 65 6e 20 60 52 65 63 65 69 70 ase when `Receip 0230 74 60 2e 60 74 79 70 65 60 20 3d 20 3f 20 74 68 t`.`type` = ? th 0240 65 6e 20 63 61 73 74 28 69 66 6e 75 6c 6c 28 60 en cast(ifnull(` 0250 52 65 63 65 69 70 74 50 61 79 6d 65 6e 74 60 2e ReceiptPayment`. 0260 60 70 61 79 6d 65 6e 74 54 6f 74 61 6c 60 2c 20 `paymentTotal`, 0270 3f 29 20 61 73 20 73 69 67 6e 65 64 29 20 65 6c ?) as signed) el 0280 73 65 20 3f 20 65 6e 64 29 20 61 73 20 73 69 67 se ? end) as sig 0290 6e 65 64 29 20 61 73 20 60 72 65 66 75 6e 64 41 ned) as `refundA 02a0 6d 6f 75 6e 74 60 2c 20 63 61 73 74 28 73 75 6d mount`, cast(sum 02b0 28 63 61 73 65 20 77 68 65 6e 20 60 52 65 63 65 (case when `Rece 02c0 69 70 74 60 2e 60 74 79 70 65 60 20 3d 20 3f 20 ipt`.`type` = ? 02d0 74 68 65 6e 20 63 61 73 74 28 69 66 6e 75 6c 6c then cast(ifnull 02e0 28 60 52 65 63 65 69 70 74 50 61 79 6d 65 6e 74 (`ReceiptPayment 02f0 60 2e 60 61 6d 6f 75 6e 74 54 69 70 73 60 2c 20 `.`amountTips`, 0300 3f 29 20 61 73 20 73 69 67 6e 65 64 29 20 65 6c ?) as signed) el 0310 73 65 20 28 3f 20 2d 20 60 52 65 63 65 69 70 74 se (? - `Receipt 0320 50 61 79 6d 65 6e 74 60 2e 60 61 6d 6f 75 6e 74 Payment`.`amount 0330 54 69 70 73 60 29 20 65 6e 64 29 20 61 73 20 73 Tips`) end) as s 0340 69 67 6e 65 64 29 20 61 73 20 60 74 69 70 73 41 igned) as `tipsA 0350 6d 6f 75 6e 74 60 2c 20 63 61 73 74 28 73 75 6d mount`, cast(sum 0360 28 63 61 73 65 20 77 68 65 6e 20 60 52 65 63 65 (case when `Rece 0370 69 70 74 60 2e 60 74 79 70 65 60 20 3d 20 3f 20 ipt`.`type` = ? 0380 74 68 65 6e 20 63 61 73 74 28 60 52 65 66 49 64 then cast(`RefId 0390 54 6f 6b 65 6e 60 2e 60 61 6d 6f 75 6e 74 53 75 Token`.`amountSu 03a0 72 63 68 61 72 67 65 60 20 61 73 20 73 69 67 6e rcharge` as sign 03b0 65 64 29 20 65 6c 73 65 20 28 3f 20 2d 20 60 52 ed) else (? - `R 03c0 65 66 49 64 54 6f 6b 65 6e 60 2e 60 61 6d 6f 75 efIdToken`.`amou 03d0 6e 74 53 75 72 63 68 61 72 67 65 60 29 20 65 6e ntSurcharge`) en 03e0 64 29 20 61 73 20 73 69 67 6e 65 64 29 20 61 73 d) as signed) as 03f0 20 60 61 6d 6f 75 6e 74 53 75 72 63 68 61 72 67 `amountSurcharg 0400 65 60 20 66 72 6f 6d 20 60 52 65 63 65 69 70 74 e` from `Receipt 0410 60 20 6c 65 66 74 20 6f 75 74 65 72 20 6a 6f 69 ` left outer joi 0420 6e 20 60 52 65 63 65 69 70 74 50 61 79 6d 65 6e n `ReceiptPaymen 0430 74 60 20 6f 6e 20 60 52 65 63 65 69 70 74 60 2e t` on `Receipt`. 0440 60 69 64 60 20 3d 20 60 52 65 63 65 69 70 74 50 `id` = `ReceiptP 0450 61 79 6d 65 6e 74 60 2e 60 72 65 63 65 69 70 74 ayment`.`receipt 0460 49 64 60 20 6c 65 66 74 20 6f 75 74 65 72 20 6a Id` left outer j 0470 6f 69 6e 20 60 50 61 79 6d 65 6e 74 54 79 70 65 oin `PaymentType 0480 60 20 6f 6e 20 60 52 65 63 65 69 70 74 50 61 79 ` on `ReceiptPay 0490 6d 65 6e 74 60 2e 60 70 61 79 6d 65 6e 74 54 79 ment`.`paymentTy 04a0 70 65 49 64 60 20 3d 20 60 50 61 79 6d 65 6e 74 peId` = `Payment 04b0 54 79 70 65 60 2e 60 69 64 60 20 6c 65 66 74 20 Type`.`id` left 04c0 6f 75 74 65 72 20 6a 6f 69 6e 20 60 52 65 66 49 outer join `RefI 04d0 64 54 6f 6b 65 6e 60 20 6f 6e 20 60 52 65 63 65 dToken` on `Rece 04e0 69 70 74 50 61 79 6d 65 6e 74 60 2e 60 69 64 60 iptPayment`.`id` 04f0 20 3d 20 60 52 65 66 49 64 54 6f 6b 65 6e 60 2e = `RefIdToken`. 0500 60 72 65 63 65 69 70 74 50 61 79 6d 65 6e 74 49 `receiptPaymentI 0510 64 60 20 77 68 65 72 65 20 28 60 52 65 63 65 69 d` where (`Recei 0520 70 74 60 2e 60 69 64 60 20 69 6e 20 28 3f 29 20 pt`.`id` in (?) 0530 61 6e 64 20 28 60 52 65 63 65 69 70 74 60 2e 60 and (`Receipt`.` 0540 74 79 70 65 60 20 3d 20 3f 20 6f 72 20 60 52 65 type` = ? or `Re 0550 63 65 69 70 74 60 2e 60 74 79 70 65 60 20 3d 20 ceipt`.`type` = 0560 3f 29 29 20 67 72 6f 75 70 20 62 79 20 60 52 65 ?)) group by `Re 0570 63 65 69 70 74 50 61 79 6d 65 6e 74 60 2e 60 70 ceiptPayment`.`p 0580 61 79 6d 65 6e 74 54 79 70 65 49 64 60 2c 20 60 aymentTypeId`, ` 0590 52 65 63 65 69 70 74 60 2e 60 6f 75 74 6c 65 74 Receipt`.`outlet 05a0 49 64 60 2c 20 3f Id`, ? Prepare response: 0000 00 00 00 00 00 00 00 00 00 00 00 00 08 00 45 00 ..............E. 0010 04 55 74 54 40 00 40 06 c4 4c 7f 00 00 01 7f 00 .UtT@.@..L...... 0020 00 01 0c ea a8 44 42 b9 96 22 a3 9c 4e af 80 18 .....DB.."..N... 0030 02 00 02 4a 00 00 01 01 08 0a bb ae dd fb bb ae ...J............ 0040 dd e2 0c 00 00 01 00 01 00 00 00 0a 00 15 00 00 ................ 0050 00 00 17 00 00 02 03 64 65 66 00 00 00 01 3f 00 .......def....?. 0060 0c e0 00 fc ff 00 00 fd 00 00 1f 00 00 17 00 00 ................ 0070 03 03 64 65 66 00 00 00 01 3f 00 0c 3f 00 17 00 ..def....?..?... 0080 00 00 05 80 00 1f 00 00 17 00 00 04 03 64 65 66 .............def 0090 00 00 00 01 3f 00 0c 3f 00 17 00 00 00 05 80 00 ....?..?........ 00a0 1f 00 00 17 00 00 05 03 64 65 66 00 00 00 01 3f ........def....? 00b0 00 0c e0 00 fc ff 00 00 fd 00 00 1f 00 00 17 00 ................ 00c0 00 06 03 64 65 66 00 00 00 01 3f 00 0c 3f 00 15 ...def....?..?.. 00d0 00 00 00 08 80 00 00 00 00 17 00 00 07 03 64 65 ..............de 00e0 66 00 00 00 01 3f 00 0c 3f 00 15 00 00 00 08 80 f....?..?....... 00f0 00 00 00 00 17 00 00 08 03 64 65 66 00 00 00 01 .........def.... 0100 3f 00 0c e0 00 fc ff 00 00 fd 00 00 1f 00 00 17 ?............... 0110 00 00 09 03 64 65 66 00 00 00 01 3f 00 0c 3f 00 ....def....?..?. 0120 17 00 00 00 05 80 00 1f 00 00 17 00 00 0a 03 64 ...............d 0130 65 66 00 00 00 01 3f 00 0c 3f 00 17 00 00 00 05 ef....?..?...... 0140 80 00 1f 00 00 17 00 00 0b 03 64 65 66 00 00 00 ..........def... 0150 01 3f 00 0c e0 00 fc ff 00 00 fd 00 00 1f 00 00 .?.............. 0160 17 00 00 0c 03 64 65 66 00 00 00 01 3f 00 0c 3f .....def....?..? 0170 00 15 00 00 00 08 80 00 00 00 00 17 00 00 0d 03 ................ 0180 64 65 66 00 00 00 01 3f 00 0c 3f 00 15 00 00 00 def....?..?..... 0190 08 80 00 00 00 00 17 00 00 0e 03 64 65 66 00 00 ...........def.. 01a0 00 01 3f 00 0c e0 00 fc ff 00 00 fd 00 00 1f 00 ..?............. 01b0 00 17 00 00 0f 03 64 65 66 00 00 00 01 3f 00 0c ......def....?.. 01c0 3f 00 15 00 00 00 08 80 00 00 00 00 17 00 00 10 ?............... 01d0 03 64 65 66 00 00 00 01 3f 00 0c 3f 00 15 00 00 .def....?..?.... 01e0 00 08 80 00 00 00 00 17 00 00 11 03 64 65 66 00 ............def. 01f0 00 00 01 3f 00 0c e0 00 fc ff 00 00 fd 00 00 1f ...?............ 0200 00 00 17 00 00 12 03 64 65 66 00 00 00 01 3f 00 .......def....?. 0210 0c 3f 00 15 00 00 00 08 80 00 00 00 00 17 00 00 .?.............. 0220 13 03 64 65 66 00 00 00 01 3f 00 0c 3f 00 15 00 ..def....?..?... 0230 00 00 08 80 00 00 00 00 17 00 00 14 03 64 65 66 .............def 0240 00 00 00 01 3f 00 0c e0 00 fc ff 00 00 fd 00 00 ....?........... 0250 1f 00 00 17 00 00 15 03 64 65 66 00 00 00 01 3f ........def....? 0260 00 0c e0 00 fc ff 00 00 fd 00 00 1f 00 00 3e 00 ..............>. 0270 00 16 03 64 65 66 0a 63 6a 74 65 73 74 5f 38 5f ...def.cjtest_8_ 0280 30 07 52 65 63 65 69 70 74 07 52 65 63 65 69 70 0.Receipt.Receip 0290 74 08 6f 75 74 6c 65 74 49 64 08 6f 75 74 6c 65 t.outletId.outle 02a0 74 49 64 0c 3f 00 0b 00 00 00 03 08 40 00 00 00 tId.?.......@... 02b0 56 00 00 17 03 64 65 66 0a 63 6a 74 65 73 74 5f V....def.cjtest_ 02c0 38 5f 30 0e 52 65 63 65 69 70 74 50 61 79 6d 65 8_0.ReceiptPayme 02d0 6e 74 0e 52 65 63 65 69 70 74 50 61 79 6d 65 6e nt.ReceiptPaymen 02e0 74 0d 70 61 79 6d 65 6e 74 54 79 70 65 49 64 0d t.paymentTypeId. 02f0 70 61 79 6d 65 6e 74 54 79 70 65 49 64 0c 3f 00 paymentTypeId.?. 0300 0b 00 00 00 03 08 40 00 00 00 42 00 00 18 03 64 ......@...B....d 0310 65 66 0a 63 6a 74 65 73 74 5f 38 5f 30 0b 50 61 ef.cjtest_8_0.Pa 0320 79 6d 65 6e 74 54 79 70 65 0b 50 61 79 6d 65 6e ymentType.Paymen 0330 74 54 79 70 65 06 6d 65 74 68 6f 64 06 6d 65 74 tType.method.met 0340 68 6f 64 0c e0 00 44 00 00 00 fe 00 01 00 00 00 hod...D......... 0350 23 00 00 19 03 64 65 66 00 00 00 0d 48 6f 75 72 #....def....Hour 0360 53 74 61 72 74 54 69 6d 65 00 0c ff 00 60 00 00 StartTime....`.. 0370 00 fd 00 00 1f 00 00 22 00 00 1a 03 64 65 66 00 ......."....def. 0380 00 00 0c 54 72 61 6e 73 61 63 74 69 6f 6e 73 00 ...Transactions. 0390 0c 3f 00 17 00 00 00 05 80 00 1f 00 00 23 00 00 .?...........#.. 03a0 1b 03 64 65 66 00 00 00 0d 70 61 79 6d 65 6e 74 ..def....payment 03b0 41 6d 6f 75 6e 74 00 0c 3f 00 15 00 00 00 08 80 Amount..?....... 03c0 00 00 00 00 28 00 00 1c 03 64 65 66 00 00 00 12 ....(....def.... 03d0 72 65 66 75 6e 64 54 72 61 6e 73 61 63 74 69 6f refundTransactio 03e0 6e 73 00 0c 3f 00 17 00 00 00 05 80 00 1f 00 00 ns..?........... 03f0 22 00 00 1d 03 64 65 66 00 00 00 0c 72 65 66 75 "....def....refu 0400 6e 64 41 6d 6f 75 6e 74 00 0c 3f 00 15 00 00 00 ndAmount..?..... 0410 08 80 00 00 00 00 20 00 00 1e 03 64 65 66 00 00 ...... ....def.. 0420 00 0a 74 69 70 73 41 6d 6f 75 6e 74 00 0c 3f 00 ..tipsAmount..?. 0430 15 00 00 00 08 80 00 00 00 00 25 00 00 1f 03 64 ..........%....d 0440 65 66 00 00 00 0f 61 6d 6f 75 6e 74 53 75 72 63 ef....amountSurc 0450 68 61 72 67 65 00 0c 3f 00 15 00 00 00 08 80 00 harge..?........ 0460 00 00 00 ...