| Line 12... |
Line 12... |
| 12 |
from shop2020.model.v1.catalog.impl import DataService
|
12 |
from shop2020.model.v1.catalog.impl import DataService
|
| 13 |
from shop2020.model.v1.catalog.impl.CategoryManager import CategoryManager
|
13 |
from shop2020.model.v1.catalog.impl.CategoryManager import CategoryManager
|
| 14 |
from shop2020.model.v1.catalog.impl.Convertors import to_t_item, to_t_source
|
14 |
from shop2020.model.v1.catalog.impl.Convertors import to_t_item, to_t_source
|
| 15 |
from shop2020.model.v1.catalog.impl.DataService import Item, ItemChangeLog, \
|
15 |
from shop2020.model.v1.catalog.impl.DataService import Item, ItemChangeLog, \
|
| 16 |
Category, EntityIDGenerator, SimilarItems, ProductNotification, Source, \
|
16 |
Category, EntityIDGenerator, SimilarItems, ProductNotification, Source, \
|
| 17 |
SourceItemPricing, AuthorizationLog, VoucherItemMapping, CategoryVatMaster,\
|
17 |
SourceItemPricing, AuthorizationLog, VoucherItemMapping, CategoryVatMaster, \
|
| 18 |
OOSTracker,EntityTag
|
18 |
OOSTracker,EntityTag
|
| 19 |
from shop2020.thriftpy.model.v1.catalog.ttypes import status, ItemShippingInfo, \
|
19 |
from shop2020.thriftpy.model.v1.catalog.ttypes import status, ItemShippingInfo, \
|
| 20 |
ItemType
|
20 |
ItemType
|
| 21 |
from shop2020.thriftpy.model.v1.inventory.ttypes import \
|
21 |
from shop2020.thriftpy.model.v1.inventory.ttypes import \
|
| 22 |
InventoryServiceException
|
22 |
InventoryServiceException, IgnoredInventoryUpdateItems
|
| 23 |
from shop2020.utils import EmailAttachmentSender
|
23 |
from shop2020.utils import EmailAttachmentSender
|
| 24 |
from shop2020.utils.EmailAttachmentSender import mail
|
24 |
from shop2020.utils.EmailAttachmentSender import mail
|
| 25 |
from shop2020.utils.Utils import to_py_date, log_risky_flag
|
25 |
from shop2020.utils.Utils import to_py_date, log_risky_flag
|
| 26 |
from sqlalchemy import desc, asc
|
26 |
from sqlalchemy import desc, asc
|
| 27 |
from sqlalchemy.sql.expression import or_, distinct, func, and_
|
27 |
from sqlalchemy.sql.expression import or_, distinct, func, and_
|
| Line 1263... |
Line 1263... |
| 1263 |
vatPercentage = vatMaster.vatPercent
|
1263 |
vatPercentage = vatMaster.vatPercent
|
| 1264 |
if vatPercentage is None:
|
1264 |
if vatPercentage is None:
|
| 1265 |
vatPercentage = 0
|
1265 |
vatPercentage = 0
|
| 1266 |
return vatPercentage
|
1266 |
return vatPercentage
|
| 1267 |
|
1267 |
|
| - |
|
1268 |
def get_all_ignored_inventoryupdate_items_list(offset,limit):
|
| - |
|
1269 |
client = InventoryClient().get_client()
|
| - |
|
1270 |
itemids = client.getIgnoredInventoryUpdateItemids(offset,limit)
|
| - |
|
1271 |
query = Item.query.filter(Item.id.in_(itemids))
|
| - |
|
1272 |
query = query.order_by(Item.product_group, Item.brand, Item.model_number, Item.model_name)
|
| - |
|
1273 |
print query.all()
|
| - |
|
1274 |
return query.all()
|
| - |
|
1275 |
|
| - |
|
1276 |
|
| 1268 |
def add_tag (displayName, catalogId):
|
1277 |
def add_tag (displayName, catalogId):
|
| 1269 |
ent_tag = None
|
1278 |
ent_tag = None
|
| 1270 |
if catalogId is None or (not is_valid_catalog_id(catalogId)):
|
1279 |
if catalogId is None or (not is_valid_catalog_id(catalogId)):
|
| 1271 |
raise InventoryServiceException(id, "Invalid CatalogId")
|
1280 |
raise InventoryServiceException(id, "Invalid CatalogId")
|
| 1272 |
else:
|
1281 |
else:
|
| Line 1291... |
Line 1300... |
| 1291 |
return True
|
1300 |
return True
|
| 1292 |
|
1301 |
|
| 1293 |
def delete_entity_tag(displayName, catalogId):
|
1302 |
def delete_entity_tag(displayName, catalogId):
|
| 1294 |
session.query(EntityTag.tag).filter_by(tag=displayName,entityId=catalogId).delete()
|
1303 |
session.query(EntityTag.tag).filter_by(tag=displayName,entityId=catalogId).delete()
|
| 1295 |
session.commit()
|
1304 |
session.commit()
|
| 1296 |
return True
|
- |
|
| 1297 |
|
- |
|
| 1298 |
|
1305 |
return True
|
| - |
|
1306 |
|
| 1299 |
|
1307 |
|