Subversion Repositories SmartDukaan

Rev

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

Rev 5966 Rev 5978
Line 86... Line 86...
86
     - warehouse_id
86
     - warehouse_id
87
     - item_id
87
     - item_id
88
    """
88
    """
89
    pass
89
    pass
90
 
90
 
91
  def getItemAvailabilityAtLocation(self, itemId):
91
  def getItemAvailabilityAtLocation(self, itemId, sourceId):
92
    """
92
    """
93
    Determines the warehouse that should be used to fulfil an order for the given item.
93
    Determines the warehouse that should be used to fulfil an order for the given item.
94
    It first checks all the warehouses which are in the logistics location given by the
94
    It first checks all the warehouses which are in the logistics location given by the
95
    warehouse_loc parameter. If none of the warehouses there have any inventory, then the
95
    warehouse_loc parameter. If none of the warehouses there have any inventory, then the
96
    preferred warehouse for the item is used.
96
    preferred warehouse for the item is used.
Line 100... Line 100...
100
    2. Expected delay added by the category manager.
100
    2. Expected delay added by the category manager.
101
    3. Id of the billing warehouse which was finally picked up.
101
    3. Id of the billing warehouse which was finally picked up.
102
 
102
 
103
    Parameters:
103
    Parameters:
104
     - itemId
104
     - itemId
-
 
105
     - sourceId
105
    """
106
    """
106
    pass
107
    pass
107
 
108
 
108
  def getAllWarehouses(self, isActive):
109
  def getAllWarehouses(self, isActive):
109
    """
110
    """
Line 630... Line 631...
630
      return result.success
631
      return result.success
631
    if result.cex is not None:
632
    if result.cex is not None:
632
      raise result.cex
633
      raise result.cex
633
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getItemAvailibilityAtWarehouse failed: unknown result");
634
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getItemAvailibilityAtWarehouse failed: unknown result");
634
 
635
 
635
  def getItemAvailabilityAtLocation(self, itemId):
636
  def getItemAvailabilityAtLocation(self, itemId, sourceId):
636
    """
637
    """
637
    Determines the warehouse that should be used to fulfil an order for the given item.
638
    Determines the warehouse that should be used to fulfil an order for the given item.
638
    It first checks all the warehouses which are in the logistics location given by the
639
    It first checks all the warehouses which are in the logistics location given by the
639
    warehouse_loc parameter. If none of the warehouses there have any inventory, then the
640
    warehouse_loc parameter. If none of the warehouses there have any inventory, then the
640
    preferred warehouse for the item is used.
641
    preferred warehouse for the item is used.
Line 644... Line 645...
644
    2. Expected delay added by the category manager.
645
    2. Expected delay added by the category manager.
645
    3. Id of the billing warehouse which was finally picked up.
646
    3. Id of the billing warehouse which was finally picked up.
646
 
647
 
647
    Parameters:
648
    Parameters:
648
     - itemId
649
     - itemId
-
 
650
     - sourceId
649
    """
651
    """
650
    self.send_getItemAvailabilityAtLocation(itemId)
652
    self.send_getItemAvailabilityAtLocation(itemId, sourceId)
651
    return self.recv_getItemAvailabilityAtLocation()
653
    return self.recv_getItemAvailabilityAtLocation()
652
 
654
 
653
  def send_getItemAvailabilityAtLocation(self, itemId):
655
  def send_getItemAvailabilityAtLocation(self, itemId, sourceId):
654
    self._oprot.writeMessageBegin('getItemAvailabilityAtLocation', TMessageType.CALL, self._seqid)
656
    self._oprot.writeMessageBegin('getItemAvailabilityAtLocation', TMessageType.CALL, self._seqid)
655
    args = getItemAvailabilityAtLocation_args()
657
    args = getItemAvailabilityAtLocation_args()
656
    args.itemId = itemId
658
    args.itemId = itemId
-
 
659
    args.sourceId = sourceId
657
    args.write(self._oprot)
660
    args.write(self._oprot)
658
    self._oprot.writeMessageEnd()
661
    self._oprot.writeMessageEnd()
659
    self._oprot.trans.flush()
662
    self._oprot.trans.flush()
660
 
663
 
661
  def recv_getItemAvailabilityAtLocation(self, ):
664
  def recv_getItemAvailabilityAtLocation(self, ):
Line 772... Line 775...
772
      raise result.cex
775
      raise result.cex
773
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getAllItemsForWarehouse failed: unknown result");
776
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getAllItemsForWarehouse failed: unknown result");
774
 
777
 
775
  def isOrderBillable(self, itemId, warehouseId, sourceId, orderId):
778
  def isOrderBillable(self, itemId, warehouseId, sourceId, orderId):
776
    """
779
    """
777
    Depending on reservation in the table, verify wether we can bill this order or not.
780
    Depending on reservation in the table, verify if we can bill this order or not.
778
 
781
 
779
    Parameters:
782
    Parameters:
780
     - itemId
783
     - itemId
781
     - warehouseId
784
     - warehouseId
782
     - sourceId
785
     - sourceId
Line 1726... Line 1729...
1726
    args = getItemAvailabilityAtLocation_args()
1729
    args = getItemAvailabilityAtLocation_args()
1727
    args.read(iprot)
1730
    args.read(iprot)
1728
    iprot.readMessageEnd()
1731
    iprot.readMessageEnd()
1729
    result = getItemAvailabilityAtLocation_result()
1732
    result = getItemAvailabilityAtLocation_result()
1730
    try:
1733
    try:
1731
      result.success = self._handler.getItemAvailabilityAtLocation(args.itemId)
1734
      result.success = self._handler.getItemAvailabilityAtLocation(args.itemId, args.sourceId)
1732
    except InventoryServiceException, isex:
1735
    except InventoryServiceException, isex:
1733
      result.isex = isex
1736
      result.isex = isex
1734
    oprot.writeMessageBegin("getItemAvailabilityAtLocation", TMessageType.REPLY, seqid)
1737
    oprot.writeMessageBegin("getItemAvailabilityAtLocation", TMessageType.REPLY, seqid)
1735
    result.write(oprot)
1738
    result.write(oprot)
1736
    oprot.writeMessageEnd()
1739
    oprot.writeMessageEnd()
Line 3185... Line 3188...
3185
 
3188
 
3186
class getItemAvailabilityAtLocation_args:
3189
class getItemAvailabilityAtLocation_args:
3187
  """
3190
  """
3188
  Attributes:
3191
  Attributes:
3189
   - itemId
3192
   - itemId
-
 
3193
   - sourceId
3190
  """
3194
  """
3191
 
3195
 
3192
  thrift_spec = (
3196
  thrift_spec = (
3193
    None, # 0
3197
    None, # 0
3194
    (1, TType.I64, 'itemId', None, None, ), # 1
3198
    (1, TType.I64, 'itemId', None, None, ), # 1
-
 
3199
    (2, TType.I64, 'sourceId', None, None, ), # 2
3195
  )
3200
  )
3196
 
3201
 
3197
  def __init__(self, itemId=None,):
3202
  def __init__(self, itemId=None, sourceId=None,):
3198
    self.itemId = itemId
3203
    self.itemId = itemId
-
 
3204
    self.sourceId = sourceId
3199
 
3205
 
3200
  def read(self, iprot):
3206
  def read(self, iprot):
3201
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
3207
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
3202
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
3208
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
3203
      return
3209
      return
Line 3209... Line 3215...
3209
      if fid == 1:
3215
      if fid == 1:
3210
        if ftype == TType.I64:
3216
        if ftype == TType.I64:
3211
          self.itemId = iprot.readI64();
3217
          self.itemId = iprot.readI64();
3212
        else:
3218
        else:
3213
          iprot.skip(ftype)
3219
          iprot.skip(ftype)
-
 
3220
      elif fid == 2:
-
 
3221
        if ftype == TType.I64:
-
 
3222
          self.sourceId = iprot.readI64();
-
 
3223
        else:
-
 
3224
          iprot.skip(ftype)
3214
      else:
3225
      else:
3215
        iprot.skip(ftype)
3226
        iprot.skip(ftype)
3216
      iprot.readFieldEnd()
3227
      iprot.readFieldEnd()
3217
    iprot.readStructEnd()
3228
    iprot.readStructEnd()
3218
 
3229
 
Line 3223... Line 3234...
3223
    oprot.writeStructBegin('getItemAvailabilityAtLocation_args')
3234
    oprot.writeStructBegin('getItemAvailabilityAtLocation_args')
3224
    if self.itemId is not None:
3235
    if self.itemId is not None:
3225
      oprot.writeFieldBegin('itemId', TType.I64, 1)
3236
      oprot.writeFieldBegin('itemId', TType.I64, 1)
3226
      oprot.writeI64(self.itemId)
3237
      oprot.writeI64(self.itemId)
3227
      oprot.writeFieldEnd()
3238
      oprot.writeFieldEnd()
-
 
3239
    if self.sourceId is not None:
-
 
3240
      oprot.writeFieldBegin('sourceId', TType.I64, 2)
-
 
3241
      oprot.writeI64(self.sourceId)
-
 
3242
      oprot.writeFieldEnd()
3228
    oprot.writeFieldStop()
3243
    oprot.writeFieldStop()
3229
    oprot.writeStructEnd()
3244
    oprot.writeStructEnd()
3230
 
3245
 
3231
  def validate(self):
3246
  def validate(self):
3232
    return
3247
    return