Subversion Repositories SmartDukaan

Rev

Rev 2832 | Rev 3424 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2832 Rev 3383
Line 21... Line 21...
21
  print 'Usage: ' + sys.argv[0] + ' [-h host:port] [-u url] [-f[ramed]] function [arg1 [arg2...]]'
21
  print 'Usage: ' + sys.argv[0] + ' [-h host:port] [-u url] [-f[ramed]] function [arg1 [arg2...]]'
22
  print ''
22
  print ''
23
  print 'Functions:'
23
  print 'Functions:'
24
  print '  i64 createPurchaseOrder(PurchaseOrder purchaseOrder)'
24
  print '  i64 createPurchaseOrder(PurchaseOrder purchaseOrder)'
25
  print '  PurchaseOrder getPurchaseOrder(i64 id)'
25
  print '  PurchaseOrder getPurchaseOrder(i64 id)'
-
 
26
  print '   getAllPurchaseOrders(POStatus status)'
26
  print '  Supplier getSupplier(i64 id)'
27
  print '  Supplier getSupplier(i64 id)'
27
  print '  i64 startPurchase(i64 purchaseOrderId, string invoiceNumber, double freightCharges)'
28
  print '  i64 startPurchase(i64 purchaseOrderId, string invoiceNumber, double freightCharges)'
28
  print '  i64 closePurchase(i64 purchaseId)'
29
  print '  i64 closePurchase(i64 purchaseId)'
-
 
30
  print '   getAllPurchases(i64 purchaseOrderId, bool open)'
29
  print '  void scanIn(i64 purchaseId, i64 itemId, string itemNumber, string imeiNumber, ScanType type)'
31
  print '  void scanIn(i64 purchaseId, string itemNumber, string imeiNumber, ScanType type)'
30
  print '  void scanOut(i64 itemNumber, i64 imeiNumber, ScanType type)'
32
  print '  void scanOut(i64 itemNumber, i64 imeiNumber, ScanType type)'
31
  print ''
33
  print ''
32
  sys.exit(0)
34
  sys.exit(0)
33
 
35
 
34
pp = pprint.PrettyPrinter(indent = 2)
36
pp = pprint.PrettyPrinter(indent = 2)
Line 86... Line 88...
86
  if len(args) != 1:
88
  if len(args) != 1:
87
    print 'getPurchaseOrder requires 1 args'
89
    print 'getPurchaseOrder requires 1 args'
88
    sys.exit(1)
90
    sys.exit(1)
89
  pp.pprint(client.getPurchaseOrder(eval(args[0]),))
91
  pp.pprint(client.getPurchaseOrder(eval(args[0]),))
90
 
92
 
-
 
93
elif cmd == 'getAllPurchaseOrders':
-
 
94
  if len(args) != 1:
-
 
95
    print 'getAllPurchaseOrders requires 1 args'
-
 
96
    sys.exit(1)
-
 
97
  pp.pprint(client.getAllPurchaseOrders(eval(args[0]),))
-
 
98
 
91
elif cmd == 'getSupplier':
99
elif cmd == 'getSupplier':
92
  if len(args) != 1:
100
  if len(args) != 1:
93
    print 'getSupplier requires 1 args'
101
    print 'getSupplier requires 1 args'
94
    sys.exit(1)
102
    sys.exit(1)
95
  pp.pprint(client.getSupplier(eval(args[0]),))
103
  pp.pprint(client.getSupplier(eval(args[0]),))
Line 104... Line 112...
104
  if len(args) != 1:
112
  if len(args) != 1:
105
    print 'closePurchase requires 1 args'
113
    print 'closePurchase requires 1 args'
106
    sys.exit(1)
114
    sys.exit(1)
107
  pp.pprint(client.closePurchase(eval(args[0]),))
115
  pp.pprint(client.closePurchase(eval(args[0]),))
108
 
116
 
-
 
117
elif cmd == 'getAllPurchases':
-
 
118
  if len(args) != 2:
-
 
119
    print 'getAllPurchases requires 2 args'
-
 
120
    sys.exit(1)
-
 
121
  pp.pprint(client.getAllPurchases(eval(args[0]),eval(args[1]),))
-
 
122
 
109
elif cmd == 'scanIn':
123
elif cmd == 'scanIn':
110
  if len(args) != 5:
124
  if len(args) != 4:
111
    print 'scanIn requires 5 args'
125
    print 'scanIn requires 4 args'
112
    sys.exit(1)
126
    sys.exit(1)
113
  pp.pprint(client.scanIn(eval(args[0]),eval(args[1]),args[2],args[3],eval(args[4]),))
127
  pp.pprint(client.scanIn(eval(args[0]),args[1],args[2],eval(args[3]),))
114
 
128
 
115
elif cmd == 'scanOut':
129
elif cmd == 'scanOut':
116
  if len(args) != 3:
130
  if len(args) != 3:
117
    print 'scanOut requires 3 args'
131
    print 'scanOut requires 3 args'
118
    sys.exit(1)
132
    sys.exit(1)