Subversion Repositories SmartDukaan

Rev

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

Rev 11751 Rev 11801
Line 153... Line 153...
153
        try:
153
        try:
154
            return Supplier.get_by(id=id).to_thrift_object()
154
            return Supplier.get_by(id=id).to_thrift_object()
155
        finally:
155
        finally:
156
            self.close_session()
156
            self.close_session()
157
 
157
 
158
    def startPurchase(self, purchaseOrderId, invoiceNumber, freightCharges):
158
    def startPurchase(self, purchaseOrderId, invoiceNumber, freightCharges, purchaseComments):
159
        """
159
        """
160
        Creates a purchase for the given purchase order.
160
        Creates a purchase for the given purchase order.
161
        Throws an exception if no more purchases are allowed against the given purchase order.
161
        Throws an exception if no more purchases are allowed against the given purchase order.
162
        
162
        
163
        Parameters:
163
        Parameters:
Line 165... Line 165...
165
         - invoiceNumber
165
         - invoiceNumber
166
         - freightCharges
166
         - freightCharges
167
        """
167
        """
168
        try:
168
        try:
169
            purchase_order = PurchaseOrder.get_by(id=purchaseOrderId)
169
            purchase_order = PurchaseOrder.get_by(id=purchaseOrderId)
170
            purchase = Purchase(purchase_order, invoiceNumber, freightCharges)
170
            purchase = Purchase(purchase_order, invoiceNumber, freightCharges, purchaseComments)
171
            session.commit()
171
            session.commit()
172
            return purchase.id
172
            return purchase.id
173
        finally:
173
        finally:
174
            self.close_session()
174
            self.close_session()
175
 
175