sqlparser-devexpress 2.5.9 → 2.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1579 @@
1
+ {
2
+ "$comment": [
3
+ "Shared test cases for both projects:",
4
+ " JS (SQLParser) tests/parser.test.js : input + variables -> convertSQLToAst/convertAstToDevextreme -> must equal 'filter'",
5
+ " C# (SQLParserTests) DevexpressFilterParserTests : 'filter' -> DevexpressFilterParser.ParseFilterQuery -> must equal 'expectedSql'",
6
+ "",
7
+ "Each case:",
8
+ " id - unique case number (shown in both test runners).",
9
+ " input - original SQL given to the JS converter (documentation only). String, or array of lines.",
10
+ " filter - DevExtreme filter the JS converter must produce for 'input' (null = convertSQLToAst returns null).",
11
+ " [column, op, value] or [column, op, value, options, rawValue]; groups are [cond, 'and'|'or', cond, ...].",
12
+ " expectedSql - SQL the C# parser must produce. String, or array of lines joined with a single space.",
13
+ " note - optional explanation of non-obvious behaviour.",
14
+ " skip - optional { \"js\" | \"csharp\": \"reason\" } to skip the case in one test runner.",
15
+ "",
16
+ "SQL conventions: identifiers are double-quoted, strings are N'...', booleans become 1/0,",
17
+ "'= null' becomes IS NULL, and nested groups are wrapped as '( ... )'."
18
+ ],
19
+ "converterOptions": {
20
+ "isValueNullShortCircuit": true,
21
+ "treatNumberAsNullableBit": true
22
+ },
23
+ "variables": {
24
+ "SingleStepTransferDocument.CompanyID": 2,
25
+ "SingleStepTransferDocument.AllowedSubdealer": false,
26
+ "Example.ZeroValue": 0,
27
+ "CoreEntity0022.CompanyGroupID": 42,
28
+ "CoreEntity0022.BranchID": 7,
29
+ "Employee.District": 0,
30
+ "Employee.BranchID": 7,
31
+ "SaleInvoiceDocument.ContactID": 42,
32
+ "SaleInvoiceDocument.BranchID": 7,
33
+ "AccountingRule.CompanyID": 42,
34
+ "AccountingRule.BranchID": 7,
35
+ "Area.AreaType": 42,
36
+ "Area.BranchID": 7,
37
+ "Item.ID": 42,
38
+ "Item.BranchID": 7,
39
+ "Item.AllowedItemGroupType": "1,2",
40
+ "Item.AllowedItemGroupTypeOne": "1",
41
+ "WorkOrderLine.ApplicableUoms": [
42
+ "UOM1",
43
+ "UOM2",
44
+ "UOM3"
45
+ ],
46
+ "WorkOrderLine.CompanyID": 2,
47
+ "WorkOrderDocument.CompanyID": 42,
48
+ "WorkOrderDocument.BranchID": 7,
49
+ "TransferOutwardDocument.DocDate": "2022-01-01",
50
+ "TransferOutwardDocument.RefBranchID": 42,
51
+ "TransferOutwardDocument.CompanyID": 7,
52
+ "LeadDocument.BranchID": 42,
53
+ "LeadDocument.CompanyID": 7,
54
+ "ServiceOrderDocument.SourceID": 2,
55
+ "LeadDocument.AllowSubDealer": true,
56
+ "SupportResolution.TicketID": 123,
57
+ "SaleOrderStatusStmtGlobalRpt.StateID": null,
58
+ "SaleOrderStatusStmtGlobalRpt.RegionID": null,
59
+ "WorkOrderLine.CompanyIDs": [
60
+ "0,1"
61
+ ],
62
+ "PurchaseOrderDocument.IsMultiBrand": false,
63
+ "PurchaseOrderDocument.AllowedApplicableMake": "0",
64
+ "SampleDoc.AuthFilterID": "ID",
65
+ "ItemPrice.AllowedItemGroupType": "1,2",
66
+ "ItemPrice.AllowedNonStock": 1,
67
+ "ItemPrice.CompanyID": 7,
68
+ "AdjustmentDocument.BranchID": 42,
69
+ "AdjustmentDocument.CompanyID": 7,
70
+ "AdjustmentDocument.IsFromInvoice": true,
71
+ "AdjustmentDocument.SupplierInvoiceNos": "INV1",
72
+ "QuoteDocument.AllowedDocType": "10809,40927",
73
+ "QuoteDocument.CompanyID": 2,
74
+ "QuoteDocument.IsVehicle": true,
75
+ "PurchaseOrderLine.ItemID": 42,
76
+ "PurchaseOrderLine.VarMatrixID0": null,
77
+ "PurchaseOrderLine.VarMatrixID1": 5,
78
+ "SaleOrderDocument.AllowedDocType": "10809,40927",
79
+ "SaleOrderDocument.CompanyID": 2,
80
+ "SaleOrderDocument.CompanyContact": 15,
81
+ "SaleOrderDocument.ParentCompanyID": 3,
82
+ "SaleOrderDocument.IsVehicle": "True"
83
+ },
84
+ "groups": [
85
+ {
86
+ "name": "Simple comparisons",
87
+ "cases": [
88
+ {
89
+ "id": 1,
90
+ "input": "(ID = {CoreEntity0022.CompanyGroupID} OR ISNULL({CoreEntity0022.CompanyGroupID},0) = 0)",
91
+ "filter": [
92
+ "ID",
93
+ "=",
94
+ 42
95
+ ],
96
+ "expectedSql": "\"ID\" = 42"
97
+ },
98
+ {
99
+ "id": 5,
100
+ "input": "CompanyID = {AccountingRule.CompanyID}",
101
+ "filter": [
102
+ "CompanyID",
103
+ "=",
104
+ 42
105
+ ],
106
+ "expectedSql": "\"CompanyID\" = 42"
107
+ },
108
+ {
109
+ "id": 6,
110
+ "input": "(Level > {Area.AreaType})",
111
+ "filter": [
112
+ "Level",
113
+ ">",
114
+ 42
115
+ ],
116
+ "expectedSql": "\"Level\" > 42"
117
+ },
118
+ {
119
+ "id": 9,
120
+ "input": "(ID <> {Item.ID}) AND ( ItemGroupType = '''')",
121
+ "filter": [
122
+ [
123
+ "ID",
124
+ "<>",
125
+ 42
126
+ ],
127
+ "and",
128
+ [
129
+ "ItemGroupType",
130
+ "=",
131
+ ""
132
+ ]
133
+ ],
134
+ "expectedSql": "\"ID\" <> 42 AND \"ItemGroupType\" = N''"
135
+ },
136
+ {
137
+ "id": 15,
138
+ "input": "AddressType NOT IN (2, 4)",
139
+ "filter": [
140
+ [
141
+ "AddressType",
142
+ "!=",
143
+ 2
144
+ ],
145
+ "and",
146
+ [
147
+ "AddressType",
148
+ "!=",
149
+ 4
150
+ ]
151
+ ],
152
+ "expectedSql": "\"AddressType\" != 2 AND \"AddressType\" != 4"
153
+ },
154
+ {
155
+ "id": 16,
156
+ "input": "AddressType IN ('2', ('4')) OR AddressType =({ServiceOrderDocument .SourceID})",
157
+ "filter": [
158
+ [
159
+ "AddressType",
160
+ "=",
161
+ "2"
162
+ ],
163
+ "or",
164
+ [
165
+ "AddressType",
166
+ "=",
167
+ "4"
168
+ ],
169
+ "or",
170
+ [
171
+ "AddressType",
172
+ "=",
173
+ 2
174
+ ]
175
+ ],
176
+ "expectedSql": "\"AddressType\" = N'2' OR \"AddressType\" = N'4' OR \"AddressType\" = 2"
177
+ },
178
+ {
179
+ "id": 21,
180
+ "input": "ID IN ({WorkOrderLine.CompanyIDs}) AND 0 IN ({WorkOrderLine.CompanyIDs})",
181
+ "filter": [
182
+ [
183
+ "ID",
184
+ "=",
185
+ "0"
186
+ ],
187
+ "or",
188
+ [
189
+ "ID",
190
+ "=",
191
+ "1"
192
+ ]
193
+ ],
194
+ "expectedSql": "\"ID\" = N'0' OR \"ID\" = N'1'"
195
+ },
196
+ {
197
+ "id": 33,
198
+ "input": "{ServiceOrderDocument.SourceID} = ID",
199
+ "filter": [
200
+ "ID",
201
+ "=",
202
+ 2
203
+ ],
204
+ "expectedSql": "\"ID\" = 2"
205
+ },
206
+ {
207
+ "id": 34,
208
+ "input": "IsChecked = 1",
209
+ "filter": [
210
+ [
211
+ "IsChecked",
212
+ "=",
213
+ 1
214
+ ],
215
+ "or",
216
+ [
217
+ "IsChecked",
218
+ "=",
219
+ true
220
+ ]
221
+ ],
222
+ "expectedSql": "\"IsChecked\" = 1 OR \"IsChecked\" = 1"
223
+ },
224
+ {
225
+ "id": 49,
226
+ "input": "AccountID = {AccountingRule.CompanyId}",
227
+ "filter": [
228
+ "AccountID",
229
+ "=",
230
+ 42
231
+ ],
232
+ "expectedSql": "\"AccountID\" = 42"
233
+ }
234
+ ]
235
+ },
236
+ {
237
+ "name": "Nested groups (IN lists, AND / OR)",
238
+ "cases": [
239
+ {
240
+ "id": 3,
241
+ "input": "ContactID = {SaleInvoiceDocument.ContactID} AND AddressType IN (2, 4)",
242
+ "filter": [
243
+ [
244
+ "ContactID",
245
+ "=",
246
+ 42
247
+ ],
248
+ "and",
249
+ [
250
+ [
251
+ "AddressType",
252
+ "=",
253
+ 2
254
+ ],
255
+ "or",
256
+ [
257
+ "AddressType",
258
+ "=",
259
+ 4
260
+ ]
261
+ ]
262
+ ],
263
+ "expectedSql": "\"ContactID\" = 42 AND ( \"AddressType\" = 2 OR \"AddressType\" = 4 )"
264
+ },
265
+ {
266
+ "id": 4,
267
+ "input": "ID IN ({WorkOrderLine.ApplicableUoms}) AND (CompanyID = {WorkOrderDocument.CompanyID} OR {WorkOrderDocument.CompanyID} = 0)",
268
+ "filter": [
269
+ [
270
+ [
271
+ "ID",
272
+ "=",
273
+ "UOM1"
274
+ ],
275
+ "or",
276
+ [
277
+ "ID",
278
+ "=",
279
+ "UOM2"
280
+ ],
281
+ "or",
282
+ [
283
+ "ID",
284
+ "=",
285
+ "UOM3"
286
+ ]
287
+ ],
288
+ "and",
289
+ [
290
+ "CompanyID",
291
+ "=",
292
+ 42
293
+ ]
294
+ ],
295
+ "expectedSql": [
296
+ "( \"ID\" = N'UOM1' OR \"ID\" = N'UOM2' OR \"ID\" = N'UOM3' )",
297
+ "AND \"CompanyID\" = 42"
298
+ ]
299
+ },
300
+ {
301
+ "id": 7,
302
+ "input": "(ID <> {Item.ID}) AND (ItemGroupType IN ({Item.AllowedItemGroupType}))",
303
+ "filter": [
304
+ [
305
+ "ID",
306
+ "<>",
307
+ 42
308
+ ],
309
+ "and",
310
+ [
311
+ [
312
+ "ItemGroupType",
313
+ "=",
314
+ "1"
315
+ ],
316
+ "or",
317
+ [
318
+ "ItemGroupType",
319
+ "=",
320
+ "2"
321
+ ]
322
+ ]
323
+ ],
324
+ "expectedSql": "\"ID\" <> 42 AND ( \"ItemGroupType\" = N'1' OR \"ItemGroupType\" = N'2' )"
325
+ },
326
+ {
327
+ "id": 10,
328
+ "input": "((ISNULL({0}, 0) = 0 AND CompanyID = {1}) OR CompanyID IS NULL) OR BranchID = {0} | [LeadDocument.BranchID] | [LeadDocument.CompanyID]",
329
+ "filter": [
330
+ [
331
+ "CompanyID",
332
+ "=",
333
+ null,
334
+ {
335
+ "type": "IS"
336
+ },
337
+ null
338
+ ],
339
+ "or",
340
+ [
341
+ "BranchID",
342
+ "=",
343
+ 42
344
+ ]
345
+ ],
346
+ "expectedSql": "\"CompanyID\" IS NULL OR \"BranchID\" = 42",
347
+ "note": "ISNULL(42, 0) = 0 is false, so the whole (... AND CompanyID = 7) group is false and dropped from the OR."
348
+ },
349
+ {
350
+ "id": 32,
351
+ "input": "10 < ID AND ApplicableUoms IN ({WorkOrderLine.ApplicableUoms})",
352
+ "filter": [
353
+ [
354
+ "ID",
355
+ ">",
356
+ 10
357
+ ],
358
+ "and",
359
+ [
360
+ [
361
+ "ApplicableUoms",
362
+ "=",
363
+ "UOM1"
364
+ ],
365
+ "or",
366
+ [
367
+ "ApplicableUoms",
368
+ "=",
369
+ "UOM2"
370
+ ],
371
+ "or",
372
+ [
373
+ "ApplicableUoms",
374
+ "=",
375
+ "UOM3"
376
+ ]
377
+ ]
378
+ ],
379
+ "expectedSql": [
380
+ "\"ID\" > 10",
381
+ "AND ( \"ApplicableUoms\" = N'UOM1' OR \"ApplicableUoms\" = N'UOM2' OR \"ApplicableUoms\" = N'UOM3' )"
382
+ ]
383
+ },
384
+ {
385
+ "id": 52,
386
+ "input": "BranchID = {AdjustmentDocument.BranchID} AND CompanyID = {AdjustmentDocument.CompanyID} AND IsFromInvoice = {AdjustmentDocument.IsFromInvoice} AND (SupplierInvoiceNO IN ('{AdjustmentDocument.SupplierInvoiceNos}') OR ISNULL('{AdjustmentDocument.SupplierInvoiceNos}','''') = '''')",
387
+ "filter": [
388
+ [
389
+ [
390
+ "BranchID",
391
+ "=",
392
+ 42
393
+ ],
394
+ "and",
395
+ [
396
+ "CompanyID",
397
+ "=",
398
+ 7
399
+ ],
400
+ "and",
401
+ [
402
+ "IsFromInvoice",
403
+ "=",
404
+ true
405
+ ]
406
+ ],
407
+ "and",
408
+ [
409
+ "SupplierInvoiceNO",
410
+ "=",
411
+ "INV1"
412
+ ]
413
+ ],
414
+ "expectedSql": [
415
+ "( \"BranchID\" = 42 AND \"CompanyID\" = 7 AND \"IsFromInvoice\" = 1 )",
416
+ "AND \"SupplierInvoiceNO\" = N'INV1'"
417
+ ]
418
+ }
419
+ ]
420
+ },
421
+ {
422
+ "name": "IS NULL / IS NOT NULL",
423
+ "cases": [
424
+ {
425
+ "id": 8,
426
+ "input": "((FromDate <= '{TransferOutwardDocument.DocDate}' AND ToDate >= '{TransferOutwardDocument.DocDate}') OR ToDate is NULL) AND (BranchID = {TransferOutwardDocument.RefBranchID} OR RefBranchID is NULL) AND (CompanyID = {TransferOutwardDocument.CompanyID} OR {TransferOutwardDocument.CompanyID} = 0 OR CompanyID is NULL)",
427
+ "filter": [
428
+ [
429
+ [
430
+ [
431
+ [
432
+ "FromDate",
433
+ "<=",
434
+ "2022-01-01"
435
+ ],
436
+ "and",
437
+ [
438
+ "ToDate",
439
+ ">=",
440
+ "2022-01-01"
441
+ ]
442
+ ],
443
+ "or",
444
+ [
445
+ "ToDate",
446
+ "=",
447
+ null,
448
+ {
449
+ "type": "IS"
450
+ },
451
+ null
452
+ ]
453
+ ],
454
+ "and",
455
+ [
456
+ [
457
+ "BranchID",
458
+ "=",
459
+ 42
460
+ ],
461
+ "or",
462
+ [
463
+ "RefBranchID",
464
+ "=",
465
+ null,
466
+ {
467
+ "type": "IS"
468
+ },
469
+ null
470
+ ]
471
+ ]
472
+ ],
473
+ "and",
474
+ [
475
+ [
476
+ "CompanyID",
477
+ "=",
478
+ 7
479
+ ],
480
+ "or",
481
+ [
482
+ "CompanyID",
483
+ "=",
484
+ null,
485
+ {
486
+ "type": "IS"
487
+ },
488
+ null
489
+ ]
490
+ ]
491
+ ],
492
+ "expectedSql": [
493
+ "( ( ( \"FromDate\" <= N'2022-01-01' AND \"ToDate\" >= N'2022-01-01' ) OR \"ToDate\" IS NULL )",
494
+ "AND ( \"BranchID\" = 42 OR \"RefBranchID\" IS NULL ) )",
495
+ "AND ( \"CompanyID\" = 7 OR \"CompanyID\" IS NULL )"
496
+ ]
497
+ },
498
+ {
499
+ "id": 12,
500
+ "input": "BranchID is Null OR BranchID is not 12",
501
+ "filter": [
502
+ [
503
+ "BranchID",
504
+ "=",
505
+ null,
506
+ {
507
+ "type": "IS"
508
+ },
509
+ null
510
+ ],
511
+ "or",
512
+ [
513
+ "BranchID",
514
+ "!=",
515
+ 12,
516
+ {
517
+ "type": "IS NOT"
518
+ },
519
+ 12
520
+ ]
521
+ ],
522
+ "expectedSql": "\"BranchID\" IS NULL OR \"BranchID\" != 12",
523
+ "note": "'IS NOT 12' is not valid T-SQL, so non-NULL values keep the DevExtreme operator."
524
+ },
525
+ {
526
+ "id": 22,
527
+ "input": "CompanyID is null OR CompanyID is 7 OR CompanyID is not 8",
528
+ "filter": [
529
+ [
530
+ "CompanyID",
531
+ "=",
532
+ null,
533
+ {
534
+ "type": "IS"
535
+ },
536
+ null
537
+ ],
538
+ "or",
539
+ [
540
+ "CompanyID",
541
+ "=",
542
+ 7,
543
+ {
544
+ "type": "IS"
545
+ },
546
+ 7
547
+ ],
548
+ "or",
549
+ [
550
+ "CompanyID",
551
+ "!=",
552
+ 8,
553
+ {
554
+ "type": "IS NOT"
555
+ },
556
+ 8
557
+ ]
558
+ ],
559
+ "expectedSql": "\"CompanyID\" IS NULL OR \"CompanyID\" = 7 OR \"CompanyID\" != 8",
560
+ "note": "'IS 7' / 'IS NOT 8' are not valid T-SQL, so non-NULL values keep the DevExtreme operator."
561
+ },
562
+ {
563
+ "id": 31,
564
+ "input": "ID IN ({SaleOrderStatusStmtGlobalRpt.RegionID})",
565
+ "filter": [
566
+ "ID",
567
+ "=",
568
+ null
569
+ ],
570
+ "expectedSql": "\"ID\" IS NULL",
571
+ "note": "Plain '= null' (no options) must still become IS NULL."
572
+ },
573
+ {
574
+ "id": 48,
575
+ "input": "(CompanyID = {LeadDocument.CompanyID} OR CompanyID IS NULL) AND ItemGroupType IN ({Item.AllowedItemGroupTypeOne}) AND ({PurchaseOrderDocument.IsMultiBrand} = 0 OR ({PurchaseOrderDocument.IsMultiBrand} = 1 AND Make IN ({PurchaseOrderDocument.AllowedApplicableMake})))",
576
+ "filter": [
577
+ [
578
+ [
579
+ "CompanyID",
580
+ "=",
581
+ 7
582
+ ],
583
+ "or",
584
+ [
585
+ "CompanyID",
586
+ "=",
587
+ null,
588
+ {
589
+ "type": "IS"
590
+ },
591
+ null
592
+ ]
593
+ ],
594
+ "and",
595
+ [
596
+ "ItemGroupType",
597
+ "=",
598
+ "1"
599
+ ]
600
+ ],
601
+ "expectedSql": "( \"CompanyID\" = 7 OR \"CompanyID\" IS NULL ) AND \"ItemGroupType\" = N'1'"
602
+ },
603
+ {
604
+ "id": 53,
605
+ "input": [
606
+ "DocType IN ({QuoteDocument.AllowedDocType})",
607
+ "AND CompanyID = {QuoteDocument.CompanyID}",
608
+ "AND",
609
+ "(",
610
+ " {QuoteDocument.IsVehicle} = 0",
611
+ " OR",
612
+ " (",
613
+ " {QuoteDocument.IsVehicle} = 1",
614
+ " AND ProspectID IS NOT NULL",
615
+ " )",
616
+ ")"
617
+ ],
618
+ "filter": [
619
+ [
620
+ [
621
+ "DocType",
622
+ "=",
623
+ "10809"
624
+ ],
625
+ "or",
626
+ [
627
+ "DocType",
628
+ "=",
629
+ "40927"
630
+ ]
631
+ ],
632
+ "and",
633
+ [
634
+ "CompanyID",
635
+ "=",
636
+ 2
637
+ ],
638
+ "and",
639
+ [
640
+ "ProspectID",
641
+ "!=",
642
+ null,
643
+ {
644
+ "type": "IS NOT"
645
+ },
646
+ null
647
+ ]
648
+ ],
649
+ "expectedSql": [
650
+ "( \"DocType\" = N'10809' OR \"DocType\" = N'40927' )",
651
+ "AND \"CompanyID\" = 2",
652
+ "AND \"ProspectID\" IS NOT NULL"
653
+ ]
654
+ }
655
+ ]
656
+ },
657
+ {
658
+ "name": "ISNULL on column side - ISNULL(\"col\", default) = value",
659
+ "cases": [
660
+ {
661
+ "id": 13,
662
+ "input": "ISNULL(SourceID,0) = {ServiceOrderDocument.SourceID} OR ISNULL(SourceID,0) = 0",
663
+ "filter": [
664
+ [
665
+ "SourceID",
666
+ "=",
667
+ 2,
668
+ {
669
+ "type": "ISNULL",
670
+ "position": "column",
671
+ "defaultValue": 0
672
+ },
673
+ 2
674
+ ],
675
+ "or",
676
+ [
677
+ [
678
+ "SourceID",
679
+ "=",
680
+ 0
681
+ ],
682
+ "or",
683
+ [
684
+ "SourceID",
685
+ "=",
686
+ null,
687
+ {
688
+ "type": "ISNULL",
689
+ "position": "column",
690
+ "defaultValue": 0
691
+ },
692
+ null
693
+ ],
694
+ "or",
695
+ [
696
+ "SourceID",
697
+ "=",
698
+ false
699
+ ]
700
+ ]
701
+ ],
702
+ "expectedSql": [
703
+ "ISNULL(\"SourceID\", 0) = 2",
704
+ "OR ( \"SourceID\" = 0 OR ISNULL(\"SourceID\", 0) = 0 OR \"SourceID\" = 0 )"
705
+ ],
706
+ "note": "A null value with a column-side ISNULL compares against the default: ISNULL(col, 0) = 0."
707
+ },
708
+ {
709
+ "id": 14,
710
+ "input": "(CompanyID = {LeadDocument.CompanyID} OR ISNULL(CompanyID,0) = 0) AND (ISNULL(IsSubdealer,0) = {LeadDocument.AllowSubDealer})",
711
+ "filter": [
712
+ [
713
+ [
714
+ "CompanyID",
715
+ "=",
716
+ 7
717
+ ],
718
+ "or",
719
+ [
720
+ [
721
+ "CompanyID",
722
+ "=",
723
+ 0
724
+ ],
725
+ "or",
726
+ [
727
+ "CompanyID",
728
+ "=",
729
+ null,
730
+ {
731
+ "type": "ISNULL",
732
+ "position": "column",
733
+ "defaultValue": 0
734
+ },
735
+ null
736
+ ],
737
+ "or",
738
+ [
739
+ "CompanyID",
740
+ "=",
741
+ false
742
+ ]
743
+ ]
744
+ ],
745
+ "and",
746
+ [
747
+ "IsSubdealer",
748
+ "=",
749
+ true,
750
+ {
751
+ "type": "ISNULL",
752
+ "position": "column",
753
+ "defaultValue": 0
754
+ },
755
+ true
756
+ ]
757
+ ],
758
+ "expectedSql": [
759
+ "( \"CompanyID\" = 7 OR ( \"CompanyID\" = 0 OR ISNULL(\"CompanyID\", 0) = 0 OR \"CompanyID\" = 0 ) )",
760
+ "AND ISNULL(\"IsSubdealer\", 0) = 1"
761
+ ]
762
+ },
763
+ {
764
+ "id": 37,
765
+ "input": "ISNULL(CompanyID,0) = {LeadDocument.CompanyID}",
766
+ "filter": [
767
+ "CompanyID",
768
+ "=",
769
+ 7,
770
+ {
771
+ "type": "ISNULL",
772
+ "position": "column",
773
+ "defaultValue": 0
774
+ },
775
+ 7
776
+ ],
777
+ "expectedSql": "ISNULL(\"CompanyID\", 0) = 7"
778
+ },
779
+ {
780
+ "id": 45,
781
+ "input": "ISNULL(AllowSubDealer,0) = {LeadDocument.AllowSubDealer}",
782
+ "filter": [
783
+ "AllowSubDealer",
784
+ "=",
785
+ true,
786
+ {
787
+ "type": "ISNULL",
788
+ "position": "column",
789
+ "defaultValue": 0
790
+ },
791
+ true
792
+ ],
793
+ "expectedSql": "ISNULL(\"AllowSubDealer\", 0) = 1"
794
+ },
795
+ {
796
+ "id": 46,
797
+ "input": "(CompanyID = {SingleStepTransferDocument.CompanyID} OR {SingleStepTransferDocument.CompanyID} = 0 OR ISNULL(CompanyID,0) = 0) AND ((ISNULL(IsSubdealer,0)) IN ({SingleStepTransferDocument.AllowedSubdealer}))",
798
+ "filter": [
799
+ [
800
+ [
801
+ "CompanyID",
802
+ "=",
803
+ 2
804
+ ],
805
+ "or",
806
+ [
807
+ [
808
+ "CompanyID",
809
+ "=",
810
+ 0
811
+ ],
812
+ "or",
813
+ [
814
+ "CompanyID",
815
+ "=",
816
+ null,
817
+ {
818
+ "type": "ISNULL",
819
+ "position": "column",
820
+ "defaultValue": 0
821
+ },
822
+ null
823
+ ],
824
+ "or",
825
+ [
826
+ "CompanyID",
827
+ "=",
828
+ false
829
+ ]
830
+ ]
831
+ ],
832
+ "and",
833
+ [
834
+ [
835
+ "IsSubdealer",
836
+ "=",
837
+ false
838
+ ],
839
+ "or",
840
+ [
841
+ "IsSubdealer",
842
+ "=",
843
+ null,
844
+ {
845
+ "type": "ISNULL",
846
+ "position": "column",
847
+ "defaultValue": 0
848
+ },
849
+ null
850
+ ]
851
+ ]
852
+ ],
853
+ "expectedSql": [
854
+ "( \"CompanyID\" = 2 OR ( \"CompanyID\" = 0 OR ISNULL(\"CompanyID\", 0) = 0 OR \"CompanyID\" = 0 ) )",
855
+ "AND ( \"IsSubdealer\" = 0 OR ISNULL(\"IsSubdealer\", 0) = 0 )"
856
+ ]
857
+ },
858
+ {
859
+ "id": 47,
860
+ "input": "ISNULL(AllowSubDealer,1) = {LeadDocument.AllowSubDealer}",
861
+ "filter": [
862
+ [
863
+ "AllowSubDealer",
864
+ "=",
865
+ true
866
+ ],
867
+ "or",
868
+ [
869
+ "AllowSubDealer",
870
+ "=",
871
+ null,
872
+ {
873
+ "type": "ISNULL",
874
+ "position": "column",
875
+ "defaultValue": 1
876
+ },
877
+ null
878
+ ]
879
+ ],
880
+ "expectedSql": "\"AllowSubDealer\" = 1 OR ISNULL(\"AllowSubDealer\", 1) = 1"
881
+ },
882
+ {
883
+ "id": 51,
884
+ "input": "ItemGroupType IN ({ItemPrice.AllowedItemGroupType}) AND ((ISNULL(IsNonStock,0))={ItemPrice.AllowedNonStock}) AND (CompanyID = {ItemPrice.CompanyID} OR {ItemPrice.CompanyID} = 0 OR ISNULL(CompanyID,0) = 0)",
885
+ "filter": [
886
+ [
887
+ [
888
+ [
889
+ "ItemGroupType",
890
+ "=",
891
+ "1"
892
+ ],
893
+ "or",
894
+ [
895
+ "ItemGroupType",
896
+ "=",
897
+ "2"
898
+ ]
899
+ ],
900
+ "and",
901
+ [
902
+ [
903
+ "IsNonStock",
904
+ "=",
905
+ 1,
906
+ {
907
+ "type": "ISNULL",
908
+ "position": "column",
909
+ "defaultValue": 0
910
+ },
911
+ 1
912
+ ],
913
+ "or",
914
+ [
915
+ "IsNonStock",
916
+ "=",
917
+ true
918
+ ]
919
+ ]
920
+ ],
921
+ "and",
922
+ [
923
+ [
924
+ "CompanyID",
925
+ "=",
926
+ 7
927
+ ],
928
+ "or",
929
+ [
930
+ [
931
+ "CompanyID",
932
+ "=",
933
+ 0
934
+ ],
935
+ "or",
936
+ [
937
+ "CompanyID",
938
+ "=",
939
+ null,
940
+ {
941
+ "type": "ISNULL",
942
+ "position": "column",
943
+ "defaultValue": 0
944
+ },
945
+ null
946
+ ],
947
+ "or",
948
+ [
949
+ "CompanyID",
950
+ "=",
951
+ false
952
+ ]
953
+ ]
954
+ ]
955
+ ],
956
+ "expectedSql": [
957
+ "( ( \"ItemGroupType\" = N'1' OR \"ItemGroupType\" = N'2' )",
958
+ "AND ( ISNULL(\"IsNonStock\", 0) = 1 OR \"IsNonStock\" = 1 ) )",
959
+ "AND ( \"CompanyID\" = 7 OR ( \"CompanyID\" = 0 OR ISNULL(\"CompanyID\", 0) = 0 OR \"CompanyID\" = 0 ) )"
960
+ ]
961
+ },
962
+ {
963
+ "id": 55,
964
+ "input": "(ISNULL(ItemID,0) = {PurchaseOrderLine.ItemID}) AND (varID = ISNULL({PurchaseOrderLine.VarMatrixID0}, 0) OR ({PurchaseOrderLine.VarMatrixID0} = 0 AND ISNULL(varID, 0) = 0))",
965
+ "filter": [
966
+ [
967
+ "ItemID",
968
+ "=",
969
+ 42,
970
+ {
971
+ "type": "ISNULL",
972
+ "position": "column",
973
+ "defaultValue": 0
974
+ },
975
+ 42
976
+ ],
977
+ "and",
978
+ [
979
+ "varID",
980
+ "=",
981
+ null,
982
+ {
983
+ "type": "ISNULL",
984
+ "position": "value",
985
+ "defaultValue": 0
986
+ },
987
+ null
988
+ ]
989
+ ],
990
+ "expectedSql": "ISNULL(\"ItemID\", 0) = 42 AND \"varID\" = ISNULL(NULL, 0)",
991
+ "note": "VarMatrixID0 is null: varID = ISNULL({VarMatrixID0}, 0) keeps the null with its ISNULL default (same as case 42), and {VarMatrixID0} = 0 is false (null only equals null), so that AND group is dropped."
992
+ },
993
+ {
994
+ "id": 56,
995
+ "input": "(ISNULL(ItemID,0) = {PurchaseOrderLine.ItemID}) AND (varID = {PurchaseOrderLine.VarMatrixID1} OR ({PurchaseOrderLine.VarMatrixID1} = 0 AND ISNULL(varID, 0) = 0))",
996
+ "filter": [
997
+ [
998
+ "ItemID",
999
+ "=",
1000
+ 42,
1001
+ {
1002
+ "type": "ISNULL",
1003
+ "position": "column",
1004
+ "defaultValue": 0
1005
+ },
1006
+ 42
1007
+ ],
1008
+ "and",
1009
+ [
1010
+ "varID",
1011
+ "=",
1012
+ 5
1013
+ ]
1014
+ ],
1015
+ "expectedSql": "ISNULL(\"ItemID\", 0) = 42 AND \"varID\" = 5",
1016
+ "note": "{VarMatrixID1} = 0 is false, so the whole AND group is false and dropped from the OR."
1017
+ },
1018
+ {
1019
+ "id": 57,
1020
+ "input": "ItemID = {PurchaseOrderLine.ItemID} OR ({PurchaseOrderLine.VarMatrixID0} = 5 AND varID = 2)",
1021
+ "filter": [
1022
+ "ItemID",
1023
+ "=",
1024
+ 42
1025
+ ],
1026
+ "expectedSql": "\"ItemID\" = 42",
1027
+ "note": "A null variable compared with a value is evaluated: null = 5 is false, so the AND group is dropped from the OR."
1028
+ },
1029
+ {
1030
+ "id": 58,
1031
+ "input": "DocType IN ({SaleOrderDocument.AllowedDocType}) AND ((ISNULL(IsDealer,0)=0 AND CompanyID={SaleOrderDocument.CompanyID}) OR (ISNULL(IsDealer,0)=1 AND CompanyContact={SaleOrderDocument.CompanyContact} AND CompanyID={SaleOrderDocument.ParentCompanyID})) AND ({SaleOrderDocument.IsVehicle}=0 OR ({SaleOrderDocument.IsVehicle}=1 AND EntityType=1004))",
1032
+ "filter": [
1033
+ [
1034
+ [
1035
+ "DocType",
1036
+ "=",
1037
+ "10809"
1038
+ ],
1039
+ "or",
1040
+ [
1041
+ "DocType",
1042
+ "=",
1043
+ "40927"
1044
+ ]
1045
+ ],
1046
+ "and",
1047
+ [
1048
+ [
1049
+ [
1050
+ [
1051
+ "IsDealer",
1052
+ "=",
1053
+ 0
1054
+ ],
1055
+ "or",
1056
+ [
1057
+ "IsDealer",
1058
+ "=",
1059
+ null,
1060
+ {
1061
+ "type": "ISNULL",
1062
+ "position": "column",
1063
+ "defaultValue": 0
1064
+ },
1065
+ null
1066
+ ],
1067
+ "or",
1068
+ [
1069
+ "IsDealer",
1070
+ "=",
1071
+ false
1072
+ ]
1073
+ ],
1074
+ "and",
1075
+ [
1076
+ "CompanyID",
1077
+ "=",
1078
+ 2
1079
+ ]
1080
+ ],
1081
+ "or",
1082
+ [
1083
+ [
1084
+ [
1085
+ [
1086
+ "IsDealer",
1087
+ "=",
1088
+ 1,
1089
+ {
1090
+ "type": "ISNULL",
1091
+ "position": "column",
1092
+ "defaultValue": 0
1093
+ },
1094
+ 1
1095
+ ],
1096
+ "or",
1097
+ [
1098
+ "IsDealer",
1099
+ "=",
1100
+ true
1101
+ ]
1102
+ ],
1103
+ "and",
1104
+ [
1105
+ "CompanyContact",
1106
+ "=",
1107
+ 15
1108
+ ]
1109
+ ],
1110
+ "and",
1111
+ [
1112
+ "CompanyID",
1113
+ "=",
1114
+ 3
1115
+ ]
1116
+ ]
1117
+ ],
1118
+ "and",
1119
+ [
1120
+ "EntityType",
1121
+ "=",
1122
+ 1004
1123
+ ]
1124
+ ],
1125
+ "expectedSql": [
1126
+ "( \"DocType\" = N'10809' OR \"DocType\" = N'40927' )",
1127
+ "AND ( ( ( \"IsDealer\" = 0 OR ISNULL(\"IsDealer\", 0) = 0 OR \"IsDealer\" = 0 ) AND \"CompanyID\" = 2 )",
1128
+ "OR ( ( ( ISNULL(\"IsDealer\", 0) = 1 OR \"IsDealer\" = 1 ) AND \"CompanyContact\" = 15 ) AND \"CompanyID\" = 3 ) )",
1129
+ "AND \"EntityType\" = 1004"
1130
+ ],
1131
+ "note": "IsVehicle resolves to the string \"True\": it must be evaluated as a boolean, so {IsVehicle}=0 is false and {IsVehicle}=1 is true, leaving only EntityType = 1004 from the last group."
1132
+ }
1133
+ ]
1134
+ },
1135
+ {
1136
+ "name": "ISNULL on value side - \"col\" = ISNULL(value, defaultValue)",
1137
+ "cases": [
1138
+ {
1139
+ "id": 18,
1140
+ "input": "CompanyID = ISNULL({LeadDocument.CompanyID},0) OR (ISNULL(CompanyID,0) = 0))",
1141
+ "filter": [
1142
+ [
1143
+ "CompanyID",
1144
+ "=",
1145
+ 7,
1146
+ {
1147
+ "type": "ISNULL",
1148
+ "position": "value",
1149
+ "defaultValue": 0
1150
+ },
1151
+ 7
1152
+ ],
1153
+ "or",
1154
+ [
1155
+ [
1156
+ "CompanyID",
1157
+ "=",
1158
+ 0
1159
+ ],
1160
+ "or",
1161
+ [
1162
+ "CompanyID",
1163
+ "=",
1164
+ null,
1165
+ {
1166
+ "type": "ISNULL",
1167
+ "position": "column",
1168
+ "defaultValue": 0
1169
+ },
1170
+ null
1171
+ ],
1172
+ "or",
1173
+ [
1174
+ "CompanyID",
1175
+ "=",
1176
+ false
1177
+ ]
1178
+ ]
1179
+ ],
1180
+ "expectedSql": [
1181
+ "\"CompanyID\" = ISNULL(7, 0)",
1182
+ "OR ( \"CompanyID\" = 0 OR ISNULL(\"CompanyID\", 0) = 0 OR \"CompanyID\" = 0 )"
1183
+ ]
1184
+ },
1185
+ {
1186
+ "id": 40,
1187
+ "input": "CompanyID = ISNULL({LeadDocument.CompanyID},0)",
1188
+ "filter": [
1189
+ "CompanyID",
1190
+ "=",
1191
+ 7,
1192
+ {
1193
+ "type": "ISNULL",
1194
+ "position": "value",
1195
+ "defaultValue": 0
1196
+ },
1197
+ 7
1198
+ ],
1199
+ "expectedSql": "\"CompanyID\" = ISNULL(7, 0)"
1200
+ },
1201
+ {
1202
+ "id": 41,
1203
+ "input": "AllowSubDealer = ISNULL({LeadDocument.AllowSubDealer},0)",
1204
+ "filter": [
1205
+ "AllowSubDealer",
1206
+ "=",
1207
+ true,
1208
+ {
1209
+ "type": "ISNULL",
1210
+ "position": "value",
1211
+ "defaultValue": 0
1212
+ },
1213
+ true
1214
+ ],
1215
+ "expectedSql": "\"AllowSubDealer\" = ISNULL(1, 0)"
1216
+ },
1217
+ {
1218
+ "id": 42,
1219
+ "input": "AllowSubDealer = ISNULL({SaleOrderStatusStmtGlobalRpt.StateID},0)",
1220
+ "filter": [
1221
+ "AllowSubDealer",
1222
+ "=",
1223
+ null,
1224
+ {
1225
+ "type": "ISNULL",
1226
+ "position": "value",
1227
+ "defaultValue": 0
1228
+ },
1229
+ null
1230
+ ],
1231
+ "expectedSql": "\"AllowSubDealer\" = ISNULL(NULL, 0)"
1232
+ },
1233
+ {
1234
+ "id": 43,
1235
+ "input": "AllowSubDealer = ISNULL({LeadDocument.AllowSubDealer},1)",
1236
+ "filter": [
1237
+ "AllowSubDealer",
1238
+ "=",
1239
+ true,
1240
+ {
1241
+ "type": "ISNULL",
1242
+ "position": "value",
1243
+ "defaultValue": 1
1244
+ },
1245
+ true
1246
+ ],
1247
+ "expectedSql": "\"AllowSubDealer\" = ISNULL(1, 1)"
1248
+ }
1249
+ ]
1250
+ },
1251
+ {
1252
+ "name": "ISNULL on both sides - ISNULL(\"col\", defaultValue) = ISNULL(value, defaultValueRight)",
1253
+ "cases": [
1254
+ {
1255
+ "id": 17,
1256
+ "input": "(ISNULL(TicketID, 0) = ISNULL({SupportResolution.TicketID}, 0))",
1257
+ "filter": [
1258
+ [
1259
+ "TicketID",
1260
+ "=",
1261
+ 123,
1262
+ {
1263
+ "type": "ISNULL",
1264
+ "position": "both",
1265
+ "defaultValue": 0,
1266
+ "defaultValueRight": 0
1267
+ },
1268
+ 123
1269
+ ],
1270
+ "or",
1271
+ [
1272
+ "TicketID",
1273
+ "=",
1274
+ null
1275
+ ]
1276
+ ],
1277
+ "expectedSql": "ISNULL(\"TicketID\", 0) = ISNULL(123, 0) OR \"TicketID\" IS NULL"
1278
+ },
1279
+ {
1280
+ "id": 35,
1281
+ "input": "ISNULL(CompanyID,0) = ISNULL({TransferOutwardDocument.CompanyID},0) OR (ISNULL(CompanyID,0) = 0)",
1282
+ "filter": [
1283
+ [
1284
+ "CompanyID",
1285
+ "=",
1286
+ 7,
1287
+ {
1288
+ "type": "ISNULL",
1289
+ "position": "both",
1290
+ "defaultValue": 0,
1291
+ "defaultValueRight": 0
1292
+ },
1293
+ 7
1294
+ ],
1295
+ "or",
1296
+ [
1297
+ "CompanyID",
1298
+ "=",
1299
+ null
1300
+ ],
1301
+ "or",
1302
+ [
1303
+ "CompanyID",
1304
+ "=",
1305
+ 0
1306
+ ],
1307
+ "or",
1308
+ [
1309
+ "CompanyID",
1310
+ "=",
1311
+ null,
1312
+ {
1313
+ "type": "ISNULL",
1314
+ "position": "column",
1315
+ "defaultValue": 0
1316
+ },
1317
+ null
1318
+ ],
1319
+ "or",
1320
+ [
1321
+ "CompanyID",
1322
+ "=",
1323
+ false
1324
+ ]
1325
+ ],
1326
+ "expectedSql": [
1327
+ "ISNULL(\"CompanyID\", 0) = ISNULL(7, 0)",
1328
+ "OR \"CompanyID\" IS NULL",
1329
+ "OR \"CompanyID\" = 0",
1330
+ "OR ISNULL(\"CompanyID\", 0) = 0",
1331
+ "OR \"CompanyID\" = 0"
1332
+ ]
1333
+ },
1334
+ {
1335
+ "id": 36,
1336
+ "input": "ISNULL(CompanyID,0) = ISNULL({TransferOutwardDocument.CompanyID},0) OR (ISNULL(CompanyID,1) = 0)",
1337
+ "filter": [
1338
+ [
1339
+ "CompanyID",
1340
+ "=",
1341
+ 7,
1342
+ {
1343
+ "type": "ISNULL",
1344
+ "position": "both",
1345
+ "defaultValue": 0,
1346
+ "defaultValueRight": 0
1347
+ },
1348
+ 7
1349
+ ],
1350
+ "or",
1351
+ [
1352
+ "CompanyID",
1353
+ "=",
1354
+ null
1355
+ ],
1356
+ "or",
1357
+ [
1358
+ "CompanyID",
1359
+ "=",
1360
+ 0,
1361
+ {
1362
+ "type": "ISNULL",
1363
+ "position": "column",
1364
+ "defaultValue": 1
1365
+ },
1366
+ 0
1367
+ ],
1368
+ "or",
1369
+ [
1370
+ "CompanyID",
1371
+ "=",
1372
+ false
1373
+ ]
1374
+ ],
1375
+ "expectedSql": [
1376
+ "ISNULL(\"CompanyID\", 0) = ISNULL(7, 0)",
1377
+ "OR \"CompanyID\" IS NULL",
1378
+ "OR ISNULL(\"CompanyID\", 1) = 0",
1379
+ "OR \"CompanyID\" = 0"
1380
+ ]
1381
+ },
1382
+ {
1383
+ "id": 38,
1384
+ "input": "ISNULL(CompanyID,0) = ISNULL({LeadDocument.CompanyID},0)",
1385
+ "filter": [
1386
+ [
1387
+ "CompanyID",
1388
+ "=",
1389
+ 7,
1390
+ {
1391
+ "type": "ISNULL",
1392
+ "position": "both",
1393
+ "defaultValue": 0,
1394
+ "defaultValueRight": 0
1395
+ },
1396
+ 7
1397
+ ],
1398
+ "or",
1399
+ [
1400
+ "CompanyID",
1401
+ "=",
1402
+ null
1403
+ ]
1404
+ ],
1405
+ "expectedSql": "ISNULL(\"CompanyID\", 0) = ISNULL(7, 0) OR \"CompanyID\" IS NULL"
1406
+ },
1407
+ {
1408
+ "id": 39,
1409
+ "input": "ISNULL(CompanyID,1) = ISNULL({LeadDocument.CompanyID},2)",
1410
+ "filter": [
1411
+ "CompanyID",
1412
+ "=",
1413
+ 7,
1414
+ {
1415
+ "type": "ISNULL",
1416
+ "position": "both",
1417
+ "defaultValue": 1,
1418
+ "defaultValueRight": 2
1419
+ },
1420
+ 7
1421
+ ],
1422
+ "expectedSql": "ISNULL(\"CompanyID\", 1) = ISNULL(7, 2)"
1423
+ },
1424
+ {
1425
+ "id": 44,
1426
+ "input": "ISNULL(AllowSubDealer,0) = ISNULL({LeadDocument.AllowSubDealer},1)",
1427
+ "filter": [
1428
+ "AllowSubDealer",
1429
+ "=",
1430
+ true,
1431
+ {
1432
+ "type": "ISNULL",
1433
+ "position": "both",
1434
+ "defaultValue": 0,
1435
+ "defaultValueRight": 1
1436
+ },
1437
+ true
1438
+ ],
1439
+ "expectedSql": "ISNULL(\"AllowSubDealer\", 0) = ISNULL(1, 1)"
1440
+ }
1441
+ ]
1442
+ },
1443
+ {
1444
+ "name": "String operators, BETWEEN and escaping",
1445
+ "cases": [
1446
+ {
1447
+ "id": 11,
1448
+ "input": "FromDate Between '10-10-2021' AND '10-10-2022'",
1449
+ "filter": [
1450
+ "FromDate",
1451
+ "between",
1452
+ [
1453
+ "10-10-2021",
1454
+ "10-10-2022"
1455
+ ]
1456
+ ],
1457
+ "expectedSql": "\"FromDate\" BETWEEN N'10-10-2021' AND N'10-10-2022'"
1458
+ },
1459
+ {
1460
+ "id": 19,
1461
+ "input": "CompanyName like '{LeadDocument.CompanyID}' AND BranchName not like '{LeadDocument.BranchID}'",
1462
+ "filter": [
1463
+ [
1464
+ "CompanyName",
1465
+ "contains",
1466
+ "7"
1467
+ ],
1468
+ "and",
1469
+ [
1470
+ "BranchName",
1471
+ "notcontains",
1472
+ "42"
1473
+ ]
1474
+ ],
1475
+ "expectedSql": [
1476
+ "(ISNULL(CharIndEX(N'7',\"CompanyName\"), 0) > 0 )",
1477
+ "AND not(ISNULL(CharIndEX(N'42',\"BranchName\"), 0) > 0 )"
1478
+ ]
1479
+ },
1480
+ {
1481
+ "id": 54,
1482
+ "input": "CustomerName = 'O''Brien' AND Notes LIKE '%it''s%'",
1483
+ "filter": [
1484
+ [
1485
+ "CustomerName",
1486
+ "=",
1487
+ "O'Brien"
1488
+ ],
1489
+ "and",
1490
+ [
1491
+ "Notes",
1492
+ "contains",
1493
+ "it's"
1494
+ ]
1495
+ ],
1496
+ "expectedSql": [
1497
+ "\"CustomerName\" = N'O''Brien'",
1498
+ "AND (ISNULL(CharIndEX(N'it''s',\"Notes\"), 0) > 0 )"
1499
+ ],
1500
+ "note": "Single quotes in values must be escaped.",
1501
+ "skip": {
1502
+ "js": "JS sanitizer drops escaped quotes: 'O''Brien' becomes OBrien"
1503
+ }
1504
+ }
1505
+ ]
1506
+ },
1507
+ {
1508
+ "name": "Dropped by the JS converter (empty filter -> empty SQL)",
1509
+ "cases": [
1510
+ {
1511
+ "id": 2,
1512
+ "input": "GroupNo = {Employee.District} OR ISNULL(GroupNo,0) = 0 OR {Employee.District} = 0",
1513
+ "filter": [],
1514
+ "expectedSql": ""
1515
+ },
1516
+ {
1517
+ "id": 20,
1518
+ "input": "(RS2ID in ({SaleOrderStatusStmtGlobalRpt.StateID}) Or (ISNULL({SaleOrderStatusStmtGlobalRpt.StateID},0) =0)) And (RS3ID in (0,{SaleOrderStatusStmtGlobalRpt.RegionID}) Or ISNULL({SaleOrderStatusStmtGlobalRpt.RegionID},0) =0 )",
1519
+ "filter": [],
1520
+ "expectedSql": ""
1521
+ },
1522
+ {
1523
+ "id": 23,
1524
+ "input": "null = 0",
1525
+ "filter": [],
1526
+ "expectedSql": ""
1527
+ },
1528
+ {
1529
+ "id": 24,
1530
+ "input": "null = null",
1531
+ "filter": [],
1532
+ "expectedSql": ""
1533
+ },
1534
+ {
1535
+ "id": 25,
1536
+ "input": "null = {SaleOrderStatusStmtGlobalRpt.StateID}",
1537
+ "filter": [],
1538
+ "expectedSql": ""
1539
+ },
1540
+ {
1541
+ "id": 26,
1542
+ "input": "null = {SaleOrderStatusStmtGlobalRpt.RegionID}",
1543
+ "filter": [],
1544
+ "expectedSql": ""
1545
+ },
1546
+ {
1547
+ "id": 27,
1548
+ "input": "null = {LeadDocument.CompanyID}",
1549
+ "filter": [],
1550
+ "expectedSql": ""
1551
+ },
1552
+ {
1553
+ "id": 28,
1554
+ "input": "{LeadDocument.BranchID} = null",
1555
+ "filter": [],
1556
+ "expectedSql": ""
1557
+ },
1558
+ {
1559
+ "id": 29,
1560
+ "input": "{LeadDocument.AllowSubDealer} != null",
1561
+ "filter": [],
1562
+ "expectedSql": ""
1563
+ },
1564
+ {
1565
+ "id": 30,
1566
+ "input": "ID = {SaleOrderStatusStmtGlobalRpt.RegionID}",
1567
+ "filter": [],
1568
+ "expectedSql": ""
1569
+ },
1570
+ {
1571
+ "id": 50,
1572
+ "input": "ID IN ({SampleDoc.AuthFilterID})",
1573
+ "filter": [],
1574
+ "expectedSql": ""
1575
+ }
1576
+ ]
1577
+ }
1578
+ ]
1579
+ }