Changeset 2060


Ignore:
Timestamp:
26 Jul 2007, 20:14:20 (17 years ago)
Author:
Henrik Bettermann
Message:

see comment in #167

File:
1 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/skins/waeup_utilities/ti_167_resolve.py

    r2059 r2060  
    4040    cost = batch.getObject().getContent().cost
    4141    batch_cost[prefix_batch] = cost
    42     # query = Eq('prefix_batch',prefix_batch)
    43     # pins = aq_pins(query)
    44     # for pin in pins:
    45     #     context.portal_pins.modifyRecord(pin=pin.pin,cost=cost)
    46 # logger.info("finished to insert cost property into pins-catatlog")
     42    query = Eq('prefix_batch',prefix_batch)
     43    pins = aq_pins(query)
     44    for pin in pins:
     45        context.portal_pins.modifyRecord(pin=pin.pin,cost=cost)
     46    #rwrite("%s, %s" % (prefix_batch,cost))
     47    logger.info("Cost %s (for %s) in portal_pins replaced" % (cost,prefix_batch))
    4748query = Eq('portal_type',"Payment")
    4849payments = aq_portal(query)
     
    5657        if batch_cost.has_key(prefix_batch):
    5758            count += 1
    58             payment_doc.edit(mapping = {'amount': 
     59            payment_doc.edit(mapping = {'amount':
    5960                                        batch_cost[prefix_batch]})
     61            #rwrite("%s: %s:%s" % (count,prefix_batch,payment_doc.order_id))
     62            logger.info("Cost in payment object %s (%s) replaced (#%s)" % (payment.id,payment_doc.order_id,count))
    6063        else:
    61             rwrite("cost %s:%s not found" % (prefix_batch,payment_doc.order_id))
     64            #rwrite("cost %s:%s not found" % (prefix_batch,payment_doc.order_id))
     65            logger.info("Prefix %s (%s) not found" % (prefix_batch,payment_doc.order_id))
    6266            no_cost +=1
    6367logger.info("updated %d payment amounts, %d costs not found" % (count,no_cost))
    6468
    65    
     69
Note: See TracChangeset for help on using the changeset viewer.