Subversion Repositories SmartDukaan

Rev

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

Rev 9980 Rev 9981
Line 1103... Line 1103...
1103
            <table border="1" style="width:100%;">
1103
            <table border="1" style="width:100%;">
1104
            <thead>
1104
            <thead>
1105
            <tr><th>Item Id</th>
1105
            <tr><th>Item Id</th>
1106
            <th>Product Name</th>
1106
            <th>Product Name</th>
1107
            <th>Old Price</th>
1107
            <th>Old Price</th>
1108
            <th>New Price %</th>
1108
            <th>New Price</th>
1109
            <th>Old Margin %</th>
1109
            <th>Old Margin %</th>
1110
            <th>New Margin</th>
1110
            <th>New Margin %</th>
1111
            <th>Snapdeal Inventory</th>
1111
            <th>Snapdeal Inventory</th>
1112
            </tr></thead>
1112
            </tr></thead>
1113
            <tbody>"""
1113
            <tbody>"""
1114
    for item in successfulAutoDecrease:
1114
    for item in successfulAutoDecrease:
1115
        it = Item.query.filter_by(id=item.item_id).one()
1115
        it = Item.query.filter_by(id=item.item_id).one()
Line 1121... Line 1121...
1121
        message+="""<tr>
1121
        message+="""<tr>
1122
                <td style="text-align:center">"""+str(item.item_id)+"""</td>
1122
                <td style="text-align:center">"""+str(item.item_id)+"""</td>
1123
                <td style="text-align:center">"""+xstr(it.brand)+" "+xstr(it.model_name)+" "+xstr(it.model_number)+" "+xstr(it.color)+"""</td>
1123
                <td style="text-align:center">"""+xstr(it.brand)+" "+xstr(it.model_name)+" "+xstr(it.model_number)+" "+xstr(it.color)+"""</td>
1124
                <td style="text-align:center">"""+str(item.ourSellingPrice)+"""</td>
1124
                <td style="text-align:center">"""+str(item.ourSellingPrice)+"""</td>
1125
                <td style="text-align:center">"""+str(math.ceil(item.proposedSellingPrice))+"""</td>
1125
                <td style="text-align:center">"""+str(math.ceil(item.proposedSellingPrice))+"""</td>
1126
                <td style="text-align:center">"""+str(round(item.margin/item.ourSellingPrice,1))+"""</td>
1126
                <td style="text-align:center">"""+str(round(item.margin/item.ourSellingPrice,2))+"""</td>
1127
                <td style="text-align:center">"""+str(round(newMargin/item.proposedSellingPrice),1)+"""</td>
1127
                <td style="text-align:center">"""+str(round(newMargin/item.proposedSellingPrice,2))+"""</td>
1128
                <td style="text-align:center">"""+str(item.ourInventory)+"""</td>
1128
                <td style="text-align:center">"""+str(item.ourInventory)+"""</td>
1129
                </tr>"""
1129
                </tr>"""
1130
    message+="""</tbody></table><h3>Auto Increase Items</h3><table border="1" style="width:100%;">
1130
    message+="""</tbody></table><h3>Auto Increase Items</h3><table border="1" style="width:100%;">
1131
            <thead>
1131
            <thead>
1132
            <tr><th>Item Id</th>
1132
            <tr><th>Item Id</th>
Line 1148... Line 1148...
1148
        message+="""<tr>
1148
        message+="""<tr>
1149
                <td style="text-align:center">"""+str(item.item_id)+"""</td>
1149
                <td style="text-align:center">"""+str(item.item_id)+"""</td>
1150
                <td style="text-align:center">"""+xstr(it.brand)+" "+xstr(it.model_name)+" "+xstr(it.model_number)+" "+xstr(it.color)+"""</td>
1150
                <td style="text-align:center">"""+xstr(it.brand)+" "+xstr(it.model_name)+" "+xstr(it.model_number)+" "+xstr(it.color)+"""</td>
1151
                <td style="text-align:center">"""+str(item.ourSellingPrice)+"""</td>
1151
                <td style="text-align:center">"""+str(item.ourSellingPrice)+"""</td>
1152
                <td style="text-align:center">"""+str(math.ceil(item.ourSellingPrice+max(10,.01*item.ourSellingPrice)))+"""</td>
1152
                <td style="text-align:center">"""+str(math.ceil(item.ourSellingPrice+max(10,.01*item.ourSellingPrice)))+"""</td>
1153
                <td style="text-align:center">"""+str(round(item.margin/item.ourSellingPrice,1))+"""</td>
1153
                <td style="text-align:center">"""+str(round(item.margin/item.ourSellingPrice,2))+"""</td>
1154
                <td style="text-align:center">"""+str(newMargin/(item.ourSellingPrice+max(10,.01*item.ourSellingPrice)))+"""</td>
1154
                <td style="text-align:center">"""+str(round(newMargin/(item.ourSellingPrice+max(10,.01*item.ourSellingPrice)),2))+"""</td>
1155
                <td style="text-align:center">"""+str(item.ourInventory)+"""</td>
1155
                <td style="text-align:center">"""+str(item.ourInventory)+"""</td>
1156
                </tr>"""
1156
                </tr>"""
1157
    message+="""</tbody></table></body></html>"""
1157
    message+="""</tbody></table></body></html>"""
1158
    print message
1158
    print message
1159
    mailServer = smtplib.SMTP("smtp.gmail.com", 587)
1159
    mailServer = smtplib.SMTP("smtp.gmail.com", 587)