Subversion Repositories SmartDukaan

Rev

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

Rev 12781 Rev 12786
Line 1646... Line 1646...
1646
        except InventoryServiceException as e:
1646
        except InventoryServiceException as e:
1647
            print sys.exc_info()[0]
1647
            print sys.exc_info()[0]
1648
            print e.message
1648
            print e.message
1649
            raise TransactionServiceException(110, 'Transfer price missing for itemId: ' + str(item_id) + ' and vendor: ' + str(warehouse.vendor.id))
1649
            raise TransactionServiceException(110, 'Transfer price missing for itemId: ' + str(item_id) + ' and vendor: ' + str(warehouse.vendor.id))
1650
 
1650
 
-
 
1651
        if order.orderType == OrderType.B2B:
-
 
1652
            tinNumber = Attribute.query.filter(Attribute.orderId == order.id).filter(Attribute.name == "tinNumber").first()
-
 
1653
            if tinNumber is None:
-
 
1654
                raise TransactionServiceException(101, "Tin Number is Missing for B2B Order. Please contact engineering Team" + str(orderId))
-
 
1655
            if newTaxType != 0:
-
 
1656
                order.orderType = OrderType.B2C
-
 
1657
 
-
 
1658
 
1651
        # For OUR warehouse, we need to scan out items for every billed order
1659
        # For OUR warehouse, we need to scan out items for every billed order
1652
        if billingType == BillingType.OURS:
1660
        if billingType == BillingType.OURS:
1653
            if order.productCondition == ProductCondition.GOOD: 
1661
            if order.productCondition == ProductCondition.GOOD: 
1654
                for index, serialNumber in enumerate(serialNumbers):
1662
                for index, serialNumber in enumerate(serialNumbers):
1655
                    try:
1663
                    try:
Line 1756... Line 1764...
1756
        if singleInvoiceAttr:
1764
        if singleInvoiceAttr:
1757
            if singleInvoiceAttr.value == "true":
1765
            if singleInvoiceAttr.value == "true":
1758
                session.commit()
1766
                session.commit()
1759
                return True
1767
                return True
1760
        if billingType == BillingType.OURS or billingType == BillingType.OURS_EXTERNAL:
1768
        if billingType == BillingType.OURS or billingType == BillingType.OURS_EXTERNAL:
1761
            order.invoice_number = get_next_invoice_number(order.orderType)
1769
            order.invoice_number = get_next_invoice_counter(order.orderType, whStateId)
1762
        session.commit()
1770
        session.commit()
1763
        return True
1771
        return True
1764
    else:
1772
    else:
1765
        return False
1773
        return False
1766
 
1774