Commit d9a2d1c8 authored by Jean-Paul Smets's avatar Jean-Paul Smets

initial checkin


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@1221 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 8675dc7d
## Script (Python) "Organisation_getOneLineAddress"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=
##title=
##
address = context.getDefaultAddress()
if address != None:
zip_code = context.getDefaultAddress().getZipCode()
city = context.getDefaultAddress().getCity()
else:
zip_code = ''
city = ''
region = context.getDefaultAddressRegion()
if region == None:
region = ''
else:
region = region.split('/')[-1]
return 'Lieu livraison : %s %s %s' % (zip_code, city, region)
## Script (Python) "Coramy_sendMailToUser"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=user_name='rc',mMsg='Message par dfaut', mSubj='Sujet par dfaut',**kw
##title=
##
try:
mailhost=getattr(context, context.portal_url.superValues('Mail Host')[0].id)
except:
raise AttributeError, "Cannot find a Mail Host object"
mFrom = context.portal_properties.email_from_name+' <'+context.portal_properties.email_from_address+'>'
# Only for doing test
if user_name == 'rc':
user_name = 'Romain_Courteaud'
mTo = user_name + '@coramy.com'
try:
# send mail to user
mailhost.send(mMsg,mTo,mFrom,mSubj)
# send mail to admin
mailhost.send(mMsg,mFrom,mFrom,mSubj)
except:
mNewMsg = 'Sujet ' + mSubj + '\n'
mNewMsg += 'Destinataire ' + mTo + '\n'
mNewMsg += 'Message ' + mMsg + '\n'
mailhost.send(mNewMsg,mFrom,mFrom,"ERP5:Coramy_sendMailToUser:Erreur")
## Script (Python) "Coramy_userLabelPrinterDefinition"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=user_name=None
##title=
##
if user_name==None:
local_user = context.portal_membership.getAuthenticatedMember().getUserName()
else:
local_user = user_name
printer_dict = {
'Nicole_Denis' : 'Meto_XS40_2',
'Christelle_Megret' : 'Meto_XS40_3',
'Jocelyne_Olejarz' : 'Meto_XS40_4',
'Nathalie_Wadoux' : 'Meto_XS40_5',
'Chantal_Hannequin' : 'Meto_XS40_5',
'Joelle_Gorriez': 'Meto_XS40_6',
'Gaelle_Manier' : 'Meto_XS40_6'
}
if local_user in printer_dict.keys():
printer_name = printer_dict[local_user]
else:
printer_name = 'Meto_XS40_2'
return printer_name
## Script (Python) "Coramy_userPrinterDefinition"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=user_name=None
##title=
##
if user_name==None:
local_user = context.portal_membership.getAuthenticatedMember().getUserName()
else:
local_user = user_name
printer_dict = {
}
if local_user in printer_dict.keys():
printer_name = printer_dict[local_user]
else:
printer_name = 'Xerox_DC_440'
return printer_name
## Script (Python) "Inventory_checkConsistency"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=
##title=
##
olist = list(context.inventaire_mp.objectValues()) + list(context.inventaire_pf.objectValues())
for o in olist:
for l in o.objectValues(spec=('CORAMY Inventory Line','ERP5 Inventory Line')):
if l.hasCellContent():
for c in l.objectValues(spec=('CORAMY Inventory Cell','ERP5 Inventory Cell')):
inventory = getattr(c, 'inventory', 0.0) # We have no acquisition here (None at class level ?)
line_inventory = getattr(l, 'inventory', 0.0)
if line_inventory is None: line_inventory = 0.0
if inventory == 0.0 and line_inventory != 0.0 and len(l.objectValues(spec=('CORAMY Inventory Cell','ERP5 Inventory Cell'))) == 1:
print "Fixing Error on %s" % c.getRelativeUrl()
c.edit(inventory = line_inventory, force_update =1 )
return printed
## Script (Python) "Inventory_copyDefault"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=
##title=
##
for l in context.objectValues(spec=('CORAMY Inventory Line','ERP5 Inventory Line')):
if l.hasCellContent():
for c in l.objectValues(spec=('CORAMY Inventory Cell','ERP5 Inventory Cell')):
inventory = getattr(c, 'inventory', 0.0) # We have acquisition here
if inventory is None: inventory=0.0
print "Update Cell %s %s" % (getattr(c, 'inventory', 0.0), inventory)
if inventory == 0.0: c.edit(inventory = inventory, force_update=1) # Only update if 0.0
else:
inventory = getattr(l, 'inventory', 0.0)
if inventory is None: inventory=0.0
print "Update Line %s %s" % (getattr(l, 'inventory', 0.0), inventory)
if inventory == 0.0: l.edit(inventory = inventory, force_update=1) # Only update if 0.0
return printed
## Script (Python) "Inventory_updateDefault"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=
##title=
##
for o in context.inventaire_mp.objectValues():
print "Inventory copy default %s" % o.getRelativeUrl()
o.activate(priority=3).Inventory_copyDefault()
for o in context.inventaire_pf.objectValues():
print "Inventory copy default %s" % o.getRelativeUrl()
o.activate(priority=3).Inventory_copyDefault()
return printed
## Script (Python) "Item_doWorkflowTransition"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=workflow_action='', workflow_id=''
##title=
##
# A shorter version of of workflow_status_modify and folder_workflow_status_modify ...
error_message = ''
action_list = context.portal_workflow.getActionsFor(context)
action_list = filter(lambda x:x.has_key('id'), action_list )
action_id_list = map(lambda x:x['id'], action_list)
# If the user is not allowed to do this transition, it will not be in action_list
if workflow_action in action_id_list:
context.portal_workflow.doActionFor(
context,
workflow_action,
wf_id=workflow_id
)
# We will check if there's an error_message
history_data = None
try:
history_data = context.portal_workflow.getInfoFor(ob=context, name='history')
except:
pass
redirect_url = None
if history_data is not None:
last_history_data = history_data[len(history_data)-1]
this_error = last_history_data.get('error_message')
if this_error != None and this_error != '':
error_message += this_error + "-"
return error_message
## Script (Python) "Item_resetLocation"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=
##title=
##
item = context
item.setLocation('')
## Script (Python) "PackingList_cleanupAssortiment"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=
##title=
##
# This script cleans packing lists we deffective quantities equal to 0.0 by resetting quantities
# to values in the simulation
for movement_brain in context.PackingList_searchAssortiment():
movement = movement_brain.getObject()
if movement.getQuantity() == 0.0:
if movement.getRelatedQuantity() is not None:
print "Fix movement %s from %s to %s" % (movement.getRelativeUrl(), movement.getQuantity(), movement.getRelatedQuantity())
#movement.setQuantity(movement.getRelatedQuantity())
else:
print "### Error movement %s has no simulation" % movement.getRelativeUrl()
else:
print "### NONSENSE on %s" % movement.getRelativeUrl()
return printed
<dtml-comment>
title:
connection_id:MySQL
max_rows:1000
max_cache:100
cache_time:0
class_name:ZSQLBrain
class_file:zsqlbrain.py
</dtml-comment>
<params></params>
SELECT DISTINCT
movement_c.*
FROM
catalog, catalog AS resource, movement, catalog AS movement_c
WHERE
movement.delivery_uid = catalog.uid
AND catalog.portal_type = "Sales Packing List"
AND resource.uid = movement.resource_uid
AND resource.portal_type = "Assortiment"
AND (movement.quantity is NULL OR movement.quantity = 0.0)
AND (movement.target_quantity is NULL OR movement.target_quantity = 0.0)
AND movement_c.uid = movement.uid
AND movement_c.portal_type = "Sales Packing List Line"
\ No newline at end of file
## Script (Python) "PackingList_setTargetStopToTargetStart"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=
##title=
##
packing_list = context
packing_list.setTargetStopDate(packing_list.getTargetStartDate())
## Script (Python) "PdfTemplate_changePdfStylesheet"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=stylesheet_name='default_pdf_template_save'
##title=
##
context.setProperty('pdf_Stylesheet',stylesheet_name)
## Script (Python) "PieceTissu_deleteFromMovement"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=
##title=
##
piece_dict = {}
piece_dict['41874']='livraison_fabrication/2004/7/movement_0_0'
piece_dict['40398']='livraison_fabrication/1838/4/movement_5_0'
piece_dict['41975']='livraison_fabrication/1873/11/movement_0_0'
piece_dict['42254']='mouvement_mp/102/19/movement_0_0'
piece_dict['36473']='livraison_fabrication/1967/1/movement_0_0'
piece_dict['36555']='mouvement_mp/98/9/movement_0_0'
piece_dict['40226']='mouvement_mp/102/9/movement_0_0'
piece_dict['40145']='livraison_fabrication/2028/8/movement_3_0'
piece_dict['40092']='livraison_fabrication/1946/1/movement_0_0'
piece_dict['41789']='mouvement_mp/82/1/movement_0_0'
piece_dict['41586']='livraison_fabrication/1950/2/movement_2_0'
for key in piece_dict.keys() :
mouvement = context.restrictedTraverse(piece_dict[key])
if mouvement is not None :
if piece_dict[key].find('mouvement_mp') != -1 :
if mouvement.getProductionQuantity() > 0 :
item_id_list = mouvement.getProducedItemIdList()
new_item_id_list = filter(lambda k_item: k_item != key, item_id_list)
mouvement.setProducedItemIdList(new_item_id_list)
else :
item_id_list = mouvement.getConsumedItemIdList()
new_item_id_list = filter(lambda k_item: k_item != key, item_id_list)
mouvement.setConsumedItemIdList(new_item_id_list)
else :
item_id_list = mouvement.getItemIdList()
new_item_id_list = filter(lambda k_item: k_item != key, item_id_list)
mouvement.setItemIdList(new_item_id_list)
print piece_dict[key], item_id_list, new_item_id_list, key
return printed
## Script (Python) "PieceTissu_exportList"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=
##title=
##
request = context.REQUEST
piece_list = context.zGetLocatedPieceTissuList()
cr = '\r'
tab = '\t'
movement_log = 'Piece'+tab+tab+'Quantit initiale'+tab+'Quantit restante'+cr
for piece_item in piece_list :
piece= piece_item.getObject()
movement_log += piece.getRelativeUrl()+tab+piece.getId()+tab+str(piece.getQuantity())+tab+str(piece.getRemainingQuantity())+tab+piece.getLocation()+tab+piece.getComment().replace('\r',' ') + cr
request.RESPONSE.setHeader('Content-Type','application/text')
return movement_log
## Script (Python) "PieceTissu_findNegativeQty"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=
##title=
##
request = context.REQUEST
cr = '\n'
tab = '\t'
movement_log = 'Problmes'+cr
piece_list = context.portal_catalog(portal_type=('Piece Tissu',))
for piece_item in piece_list :
piece = piece_item.getObject()
if piece is not None :
qty = piece.getRemainingQuantity()
if qty < 0 :
movement_log += piece.getRelativeUrl()+tab+str(qty)+cr
request.RESPONSE.setHeader('Content-Type','application/text')
return movement_log
## Script (Python) "PieceTissu_findSuspectMovement"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=
##title=
##
request = context.REQUEST
cr = '\n'
tab = '\t'
movement_log = 'Id pieces'+tab+'piece_relative_url'+tab+'In-Out'+tab+'number'+tab+'relative_url_movement'+cr
piece_list = context.portal_catalog(portal_type=('Piece Tissu',))
#piece_list = context.portal_catalog(id = ('41890','36921') , portal_type="Piece Tissu")
for piece_item in piece_list :
out_movement_list = ''
out_count = 0
in_movement_list = ''
in_count = 0
suspect_movement_list = ''
suspect_count = 0
piece = piece_item.getObject()
if piece is not None :
related_movement_list = piece.getAggregateRelatedValueList()
for movement in related_movement_list :
movement_relative_url = movement.getRelativeUrl()
if movement_relative_url.find('livraison_fabrication') != -1 :
out_movement_list += movement_relative_url + tab
out_count += 1
elif movement_relative_url.find('inventaire_mp') != -1 :
in_movement_list += movement_relative_url + tab
in_count += 1
elif movement_relative_url.find('livraison_achat') != -1 :
in_movement_list += movement_relative_url + tab
in_count += 1
elif movement_relative_url.find('mouvement_mp') != -1 :
if movement.getProductionQuantity() > 0 :
in_movement_list += movement_relative_url + tab
in_count += 1
elif movement.getConsumptionQuantity() > 0 :
out_movement_list += movement_relative_url + tab
out_count += 1
else :
suspect_movement_list += movement_relative_url + tab
suspect_count += 1
else :
suspect_movement_list += movement_relative_url + tab
suspect_count += 1
if (in_count==1 and out_count==1 and suspect_count==0) or (in_count==1 and out_count==0 and suspect_count==0) or (in_count==0 and out_count==0 and suspect_count==0):
pass
elif (in_count==0 and out_count==1 and suspect_count==0) :
if piece.aq_parent.getPortalType()=="Piece Tissu" :
pass
else :
movement_log += piece.getId() + tab + piece.getRelativeUrl() + tab + 'OUT' + tab + str(out_count) + tab + out_movement_list + cr
else :
if in_count > 0 :
movement_log += piece.getId() + tab + piece.getRelativeUrl() + tab + 'IN' + tab + str(in_count) + tab + in_movement_list + cr
if out_count > 0 :
movement_log += piece.getId() + tab + piece.getRelativeUrl() + tab + 'OUT' + tab + str(out_count) + tab + out_movement_list + cr
if suspect_count > 0 :
movement_log += piece.getId() + tab + piece.getRelativeUrl() + tab + 'SUSPECT' + tab + str(suspect_count) + tab + suspect_movement_list + cr
request.RESPONSE.setHeader('Content-Type','application/text')
return movement_log
## Script (Python) "SalesOrder_updateAssortimentPrice"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=
##title=
##
assort_dict ={}
assort_dict['009H401_12P_H']=51.00
assort_dict['009H402_12P_H']=47.40
assort_dict['009H403_12P_H']=57.00
assort_dict['108E5386_12P_H']=150.00
assort_dict['108H401_12P_H']=145.80
assort_dict['11414442_12P_H']=182.40
assort_dict['11495210_12P_H']=171.60
assort_dict['114H401_12P_H']=264.00
assort_dict['114H402_12P_H']=240.00
assort_dict['114H403_12P_H']=214.80
assort_dict['11684401_12P_H']=136.80
assort_dict['116H401_12P_H']=147.00
assort_dict['116H402_12P_H']=144.00
assort_dict['118H401_12P_H']=151.20
assort_dict['118H402_12P_H']=117.60
assort_dict['124H401_12P_H']=135.60
assort_dict['134A0104_12P_H']=115.20
assort_dict['136H401_12P_H']=149.40
assort_dict['136H402_12P_H']=192.00
assort_dict['136H403_12P_H']=192.00
assort_dict['137H401_18P_H']=234.00
assort_dict['140H401_12P_H']=107.16
assort_dict['140H402_12P_H']=109.59
assort_dict['141H401_12P_H']=131.64
assort_dict['14693101_12P_H']=199.20
assort_dict['153E5245_12P_H']=166.80
assort_dict['153F5340_12P_H']=166.80
assort_dict['153H402_12P_H']=186.00
assort_dict['153H403_12P_H']=183.00
assort_dict['15554770_12P_H']=144.00
assort_dict['15873440_12P_H']=172.80
assort_dict['158H401_12P_H']=138.00
assort_dict['16863440_12P_H']=171.60
assort_dict['168H401_12P_H']=150.00
assort_dict['168H402_12P_H']=168.00
assort_dict['168H403_12P_H']=138.00
assort_dict['169H401_12P_H']=107.16
assort_dict['169H402_12P_H']=152.40
assort_dict['169H403_12P_H']=163.20
assort_dict['19015387_18P_H']=216.00
assort_dict['19015896_12P_H']=144.00
assort_dict['213H401_12P_H']=148.20
assort_dict['223H401_12P_H']=139.20
assort_dict['223H402_12P_H']=139.20
assort_dict['230H401_12P_H']=159.60
assort_dict['232H401_12P_H']=142.80
assort_dict['232H402_12P_H']=140.40
assort_dict['232H403_12P_H']=156.00
assort_dict['233H402_12P_H']=126.00
assort_dict['233H403_12P_H']=216.00
assort_dict['236H401_12P_H']=174.00
assort_dict['237H401_12P_H']=150.00
assort_dict['237H402_12P_H']=138.00
assort_dict['237H403_12P_H']=118.80
assort_dict['237H404_12P_H']=171.00
assort_dict['237H405_12P_H']=135.00
assort_dict['237H406_12P_H']=115.20
assort_dict['237H407_12P_H']=174.00
assort_dict['237H412_12P_H']=150.00
assort_dict['240H401_12P_H']=146.40
assort_dict['240H402_12P_H']=151.20
assort_dict['240H403_12P_H']=139.20
assort_dict['245H401_12P_H']=216.00
assort_dict['246H401_12P_H']=187.20
assort_dict['247H401_12P_H']=234.00
assort_dict['247H402_12P_H']=216.00
assort_dict['24800156_12P_H']=82.80
assort_dict['24805576_12P_H']=83.40
assort_dict['24850104_12P_H']=94.80
assort_dict['24850134_12P_H']=90.00
assort_dict['24860157_12P_H']=87.60
assort_dict['248B5000_12P_H']=91.20
assort_dict['248H402_12P_H']=216.00
assort_dict['248H403_12P_H']=231.60
assort_dict['248H404_12_H']=201.60
assort_dict['248H405_12P_H']=216.00
assort_dict['248H406_12P_H']=211.20
assort_dict['248H407_12P_H']=188.40
assort_dict['248H408_12P_H']=190.80
assort_dict['248H409_12P_H']=183.00
assort_dict['248H410_12P_H']=196.80
assort_dict['25040169_12P_H']=81.00
assort_dict['25042733_12P_H']=88.80
assort_dict['25065455_12P_H']=114.00
assort_dict['251H401_12P_H']=180.00
assort_dict['251H402_12P_H']=189.60
assort_dict['251H403_12P_H']=148.80
assort_dict['251H405_12P_H']=213.60
assort_dict['25365673_12P_H']=98.40
assort_dict['25415284_12P_H']=102.00
assort_dict['25415674_12P_H']=99.60
assort_dict['26220104_12P_H']=126.00
assort_dict['27165093_12P_H']=160.80
assort_dict['27284967_12P_H']=159.00
assort_dict['274E5600_12P_H']=152.40
assort_dict['335H401_12P_H']=174.00
assort_dict['335H402_12P_H']=174.00
assort_dict['352H401_12P_H']=60.60
assort_dict['354H401_12P_H']=97.32
assort_dict['372H401_12P_H']=123.60
assort_dict['401H401_12P_H']=74.40
assort_dict['401H402_12P_H']=127.20
assort_dict['405H401_12P_H']=116.40
assort_dict['406H402_18P_H']=115.20
assort_dict['406H403_12P_H']=88.80
assort_dict['40700157_12P_H']=72.00
assort_dict['40750109_12P_H']=67.20
assort_dict['408H401_12P_H']=102.00
assort_dict['41335586_12P_H']=68.40
assort_dict['415H401_18P_H']=104.40
assort_dict['415H402_12P_H']=90.00
assort_dict['415H404_12P_H']=99.60
assort_dict['416H401_12P_H']=87.60
assort_dict['416H402_12P_H']=91.20
assort_dict['416H403_12P_H']=80.40
assort_dict['416H404_12P_H']=114.00
assort_dict['420H401_12P_H']=96.00
assort_dict['42225455_12P_H']=84.00
assort_dict['42232733_12P_H']=70.80
assort_dict['423H401_12P_H']=94.80
assort_dict['423H402_18P_H']=147.60
assort_dict['423H403_18P_H']=178.20
assort_dict['423H404_12P_H']=93.60
assort_dict['42420163_12P_H']=59.40
assort_dict['42435683_12P_H']=64.80
assort_dict['500H401_12P_H']=79.20
assort_dict['511H401_12P_H']=100.20
assort_dict['511H402_12P_H']=99.00
assort_dict['518E0157_12P_H']=67.20
assort_dict['518H401_12P_H']=76.80
assort_dict['519H401_12P_H']=90.00
assort_dict['52020109_12P_H']=75.60
assort_dict['52185530_12P_H']=71.40
assort_dict['527H401_12P_H']=103.20
assort_dict['527H402_12P_H']=68.40
assort_dict['52830164_12P_H']=54.00
assort_dict['52835683_12P_H']=68.40
assort_dict['528H401_12P_H']=90.00
assort_dict['53580108_12P_H']=51.60
assort_dict['536H401_12P_H']=74.76
assort_dict['536H402_12P_H']=85.68
assort_dict['536H403_12P_H']=67.32
assort_dict['537H401_12P_H']=74.76
assort_dict['537K0107_12P_H']=44.40
assort_dict['537K4747_12P_H']=58.80
assort_dict['538H401_12P_H']=83.40
assort_dict['538H402_12P_H']=114.00
assort_dict['543H401_12P_H']=82.80
assort_dict['590A5151_12P_H']=42.00
assort_dict['593K4747_12P_H(2-8)']=36.00
assort_dict['593K4747_12P_H(6-24m)']=33.60
assort_dict['593M5000_12P_H']=38.40
assort_dict['636H401_12P_H']=70.80
assort_dict['656H401_12P_H']=52.08
assort_dict['658H401_12P_H']=72.84
assort_dict['701H401_12P_H']=47.40
assort_dict['701H402_12P_H']=43.20
assort_dict['701H403_12P_H']=59.40
assort_dict['70255000_12P_H(10-16)']=43.80
assort_dict['70255000_16P_H(2-8)']=52.80
assort_dict['702H401_12P_H']=45.00
assort_dict['709H401_12P_H']=54.00
assort_dict['712H401_12P_H']=51.60
assort_dict['712H402_12P_H']=49.80
assort_dict['712H403_12P_H']=57.00
assort_dict['712H404_18P_H']=85.50
assort_dict['712K0108_12P_H']=39.00
assort_dict['712K0150_12P_H']=42.00
assort_dict['713H401_12P_H']=56.40
assort_dict['71414760_12P_H']=44.40
assort_dict['71415665_16P_H']=44.00
assort_dict['714B5306_12P_H']=43.80
assort_dict['714H401_12P_H']=42.00
assort_dict['714H402_12P_H']=51.48
assort_dict['714H403_12P_H']=42.24
assort_dict['714H404_12P_H']=51.60
assort_dict['715H401_12P_H']=57.60
assort_dict['715H402_12P_H']=51.60
assort_dict['720A5265_12P_H']=40.20
assort_dict['720H401_12P_H']=52.20
assort_dict['720H402_12P_H']=64.80
assort_dict['72374749_12P_H']=52.80
assort_dict['72375665_16P_H']=56.00
assort_dict['723H401_18P_H']=83.70
assort_dict['723H402_12P_H']=70.80
assort_dict['724H401_12P_H']=79.56
assort_dict['724h402_18P_H']=90.00
assort_dict['725H401_12P_H']=70.80
assort_dict['725J0108_12P_H']=43.20
assort_dict['725J0150_12P_H']=43.80
assort_dict['727H401_12P_H']=60.00
assort_dict['72845000_12P_H(10-16)']=54.00
assort_dict['72845000_16P_H(2-8)']=63.20
assort_dict['75105143_12P_H']=61.20
assort_dict['751H401_12P_H']=75.60
assort_dict['751H402_12P_H']=63.00
assort_dict['755H401_16P_H']=76.00
assort_dict['769H401_12P_H']=70.44
assort_dict['769H402_16P_H']=91.20
assort_dict['77045143_12P_H']=47.40
assort_dict['770H401_12P_H']=67.32
assort_dict['770H402_12P_H']=64.92
assort_dict['770H403_12P_H']=79.20
assort_dict['770H404_16P_H']=116.00
assort_dict['770H405_12P_H']=63.00
assort_dict['77115217_12P_H']=62.40
assort_dict['77115401_12P_H']=70.80
assort_dict['771H401_12P_H']=66.72
assort_dict['771H402_12P_H']=97.80
assort_dict['771H403_16P_H']=84.00
assort_dict['771H404_12P_H']=66.00
assort_dict['772H401_12P_H']=68.40
assort_dict['774H402_16P_H']=108.00
assort_dict['774H403_16P_H']=130.40
assort_dict['775H401_12P_H']=88.80
assort_dict['775H402_16P_H']=159.20
assort_dict['776H401_16P_H']=110.40
assort_dict['778H401_16P_H']=120.00
assort_dict['778H402_12P_H']=85.80
assort_dict['855H401_12P_H']=39.00
assort_dict['869H401_12P_H']=53.40
assort_dict['910H401_12P_H']=149.40
order = context
assort_keys = assort_dict.keys()
movement_list = order.getMovementList()
for movement in movement_list :
resource = movement.getResourceValue()
if resource is not None :
if resource.getPortalType() == "Assortiment" :
assort_id = resource.getId()
if assort_id in assort_keys :
movement.setProperty(key='price',value=assort_dict[assort_id])
#print "prix actuel : "+str(movement.getPrice())+" prix assortiment : "+str(assort_dict[assort_id])
#return printed
<dtml-comment>
title:
connection_id:MySQL
max_rows:100000
max_cache:100
cache_time:0
class_name:ZSQLBrain
class_file:zsqlbrain.py
</dtml-comment>
<params></params>
SELECT group_client.title, sum(movement.quantity) AS qte1, sum(movement.total_price) AS total_prix1,sum(other_movement.quantity) AS qte2, sum(other_movement.total_price) AS total_prix2
FROM catalog AS sale_order, catalog AS order_line, category AS category_sc
LEFT JOIN catalog as order_cell ON (order_cell.parent_uid = order_line.uid AND order_cell.portal_type = "Delivery Cell")
LEFT JOIN movement ON ( movement.uid = order_cell.uid
AND movement.has_cell_content = 0 )
LEFT JOIN movement AS other_movement ON ( other_movement.uid = order_line.uid
AND other_movement.has_cell_content = 0 )
LEFT JOIN category AS category_group ON ( category_group.uid=sale_order.uid
AND category_group.base_category_uid = <dtml-var "portal_categories.group.uid">
AND category_group.category_strict_membership = 1 )
LEFT JOIN catalog AS group_client ON ( group_client.uid = category_group.category_uid )
WHERE sale_order.portal_type = "Sales Order"
AND order_line.parent_uid = sale_order.uid
AND order_line.portal_type = "Sales Order Line"
AND (sale_order.simulation_state = "planned"
OR sale_order.simulation_state = "ordered"
OR sale_order.simulation_state = "draft"
OR sale_order.simulation_state = "confirmed")
AND category_sc.uid=sale_order.uid
AND category_sc.base_category_uid = <dtml-var "portal_categories.source_section.uid">
AND category_sc.category_uid = <dtml-var "portal_categories.group.Coramy.Houvenaegel.uid">
GROUP BY group_client.title
\ No newline at end of file
## Script (Python) "changeSourceAdministrationList"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=
##title=
##
order_list = context.changeSourceAdministrationSQL()
i = 1
for order in order_list:
order_object = order.getObject()
source_admin = order_object.getSourceAdministration()
if source_admin != 'person/347':
print order_object.getId(), order_object.getComment()
i += 1
print 'fin'
return printed
<dtml-comment>
title:
connection_id:MySQL
max_rows:1000
max_cache:100
cache_time:0
class_name:ZSQLBrain
class_file:zsqlbrain.py
</dtml-comment>
<params></params>
SELECT DISTINCT id, relative_url, path, Description
FROM catalog
WHERE simulation_state = "draft"
AND portal_type = "Sales Order"
\ No newline at end of file
## Script (Python) "check_production_delivery"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=
##title=
##
delivery_list = context.object_action_list(selection_name='production_packing_list_selection')
for delivery in delivery_list :
print '\n'+'Livraison :'+delivery.getId()
movement_list = delivery.getMovementList()
for movement in movement_list :
item_list = movement.getAggregateValueList()
if not item_list in ([], None) :
quantity = 0
for item in item_list :
# print movement.getResource(),movement.getVariationCategoryList(),item.getResource(),item.getVariationCategoryList()
# verify if resource of item == resource of movement
if movement.getResource() == item.getResource() :
# check if variation_category is the same
if movement.getVariationCategoryList() != item.getVariationCategoryList() :
print 'Problme de variante',movement.getVariationCategoryList(),item.getId(),item.getVariationCategoryList()
else :
print 'Problme de resource',movement.getResource(),item.getId(),item.getResource()
# print movement.getResource(), movement.getItemIdList()
# verify if quantity of movement == sum (item.getRemainingQuantity)
quantity += item.getRemainingQuantity()
if quantity != movement.getTargetQuantity() :
print 'Problme de quantit',movement.getTargetQuantity(),round(quantity,4)
return printed
## Script (Python) "getOneLineShortDescription"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=description='',len_max=100
##title=
##
# cut the description to fit under len_max caracteres
from string import join
result = description.split('\n')[0]
if len(result) > len_max:
result = join(result[:len_max].split(' ')[:-2]) + '...'
else:
result = description
return result
## Script (Python) "launchChangeEipAndCollection"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=
##title=
##
request = context.REQUEST
item_list = context.zGetEipChangeObjectlist()
cr = '\n'
tab = '\t'
for item_item in item_list :
item = item_item.getObject()
if item is not None:
item.activate(priority=2).updateEipAndCollection()
#request.RESPONSE.setHeader('Content-Type','application/text')
return 'lanc'+str(len(item_list))
## Script (Python) "launchResetLocationOnLocatedPieceTissu"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=
##title=
##
request = context.REQUEST
item_list = context.zGetLocatedPieceTissuList()
cr = '\n'
tab = '\t'
for item_item in item_list :
item = item_item.getObject()
if item is not None:
context.portal_activities.newMessage('SQLDict', item.getPath(), None, {}, 'Item_resetLocation')
#request.RESPONSE.setHeader('Content-Type','application/text')
return 'fait'
## Script (Python) "launchResetTargetQtyOnItemAggregatedMovement"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=
##title=
##
request = context.REQUEST
movement_list = context.zGetTissuMovementWithoutItem()
cr = '\n'
tab = '\t'
movement_log = 'Problme'+cr
for movement_item in movement_list :
movement = movement_item.getObject()
if movement is not None:
context.portal_activities.newMessage('SQLDict', movement.getPath(), None, {}, 'Movement_resetTargetQuantity')
# movement_log.append(movement.getRelativeUrl())
#request.RESPONSE.setHeader('Content-Type','application/text')
return 'fait'
## Script (Python) "launchSetStopDateONProdDelivery"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=
##title=
##
request = context.REQUEST
packing_list = context.zGetProductionDeliveryList()
cr = '\n'
tab = '\t'
for packing_item in packing_list :
packing = packing_item.getObject()
if packing is not None:
packing.activate().recursiveImmediateReindexObject()
return 'lanc'
## Script (Python) "launchTransferVetement"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=
##title=
##
request = context.REQUEST
item_list = context.zGetVetementList()
cr = '\n'
tab = '\t'
for item_item in item_list :
item = item_item.getObject()
if item is not None:
item.activate().transfer_vetement()
#request.RESPONSE.setHeader('Content-Type','application/text')
return 'lanc'+str(len(item_list))
## Script (Python) "launchUpdateAssortimentPriceOnSalesOrder"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=
##title=
##
request = context.REQUEST
item_list = context.zGetHouvSalesOrderList()
cr = '\n'
tab = '\t'
for item_item in item_list :
item = item_item.getObject()
if item is not None:
item.activate().SalesOrder_updateAssortimentPrice()
#request.RESPONSE.setHeader('Content-Type','application/text')
return 'lanc'+str(len(item_list))
## Script (Python) "launchUpdateQuantityOnItemAggregatedMovement"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=
##title=
##
request = context.REQUEST
movement_list = context.zGetItemAggregatedMovement()
cr = '\n'
tab = '\t'
movement_log = 'Problme'+cr
for movement_item in movement_list :
movement = movement_item.getObject()
if movement is not None:
context.portal_activities.newMessage('SQLDict', movement.getPath(), None, {}, 'updateQuantityOnItemAggregatedMovement')
# movement_log.append(movement.getRelativeUrl())
request.RESPONSE.setHeader('Content-Type','application/text')
return 'fait'
<?xml version="1.0" encoding="iso-8859-1"?>
<form>
<title></title>
<name>test_form</name>
<action></action>
<enctype></enctype>
<method>POST</method>
<pt>form_view</pt>
<groups>
<group>
<title>Default</title>
<fields>
<field><id>xxx</id> <type>TextAreaField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default></default>
<description></description>
<external_validator></external_validator>
<extra></extra>
<height type="int">5</height>
<hidden type="int">0</hidden>
<max_length></max_length>
<max_linelength></max_linelength>
<max_lines></max_lines>
<required type="int">1</required>
<title>xxx</title>
<width type="int">40</width>
</values>
<tales>
<default>request/toto</default>
<description>request/toto</description>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="too_many_lines">You entered too many lines.</message>
<message name="line_too_long">A line was too long.</message>
<message name="too_long">You entered too many characters.</message>
</messages>
</field>
</fields>
</group>
</groups>
</form>
\ No newline at end of file
<dtml-comment>
title:
connection_id:MySQL
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params></params>
SELECT DISTINCT
item.uid, item.id, item.path,
item.Description, item.simulation_state, item.default_destination_title,
stock.uid as stock_uid,
stock.node_uid as stock_node_uid,
stock.quantity as stock_quantity
FROM
catalog AS item
LEFT JOIN category, stock
ON (category.category_uid=item.uid
AND category.base_category_uid = <dtml-var "portal_categories.aggregate.getUid()">
AND stock.uid = category.uid)
WHERE item.portal_type = "Piece Tissu"
AND item.uid=1987190823
\ No newline at end of file
## Script (Python) "test_script"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=
##title=
##
rule = context.getSpecialiseValue()
if rule is not None:
rule.expand(context, force=1)
## Script (Python) "test_script2"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=
##title=
##
object_list = context.object_action_list(selection_name='purchase_packing_list_selection')
for object in object_list :
object.deliver()
object.invoice()
return 'fait', len(object_list)
## Script (Python) "testjp"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=
##title=
##
context.SimulationTool_buildRequirementOrder(
resource="composant/B4002",
node_category="site/Stock_MP",
section_category="group/Coramy"
)
return "Done"
#
if len(context.getCausalityRelatedValueList()) == 1:
# Only applied rule
context.activate().buildDeliveryList()
else:
return "causality is not 1"
return "Done"
#
context.SimulationTool_buildRequirementOrder(resource='composant/VIDJL')
return None
#
context.buildDeliveryList()
return "Done"
##
movement_list = []
order = context
if order.getPortalType() == 'Purchase Order' :
filter_dict = {'portal_type': 'Purchase Order Line'}
else :
filter_dict = {'portal_type': 'Sales Order Line'}
movement_list += order.getOrderRelatedValueList(portal_type = 'Simulation Movement')
for order_line in order.contentValues(filter=filter_dict) :
movement_list += order_line.getOrderRelatedValueList(portal_type = 'Simulation Movement')
for cell in order_line.contentValues(filter={'portal_type': 'Delivery Cell'}) :
movement_list += cell.getOrderRelatedValueList(portal_type = 'Simulation Movement')
root_group = context.portal_simulation.collectMovement(movement_list)
delivery_list = context.portal_simulation.buildDeliveryList(root_group)
# what's the gestionaire of this order
user_name = ''
# are we on a sales order or puchase order ?
if order.getPortalType() == 'Sales Order' :
user_name = order.getSourceAdministrationTitle().replace(' ','_')
elif order.getPortalType() == 'Purchase Order' :
user_name = order.getDestinationAdministrationPersonTitle().replace(' ','_')
for delivery in delivery_list :
# update the state of the created deliveries to 'confirmed'
delivery.confirm()
# update local_roles
delivery.assign_gestionaire_designe_roles(user_name = user_name)
return str(delivery_list)
#
context.buildDeliveryList()
return None
#
for l in context.objectValues():
print l.getRelativeUrl(), l.getInventoriatedQuantity()
for c in l.objectValues():
print c.getRelativeUrl(), c.getInventoriatedQuantity()
return printed
#
context.buildInvoiceList()
return "Done"
#
return str(context.getConvertedQuantity() is not None)
#
for l in context.objectValues():
l.immediateReindexObject()
for c in l.objectValues():
try:
c.immediateReindexObject()
except:
print c.getRelativeUrl()
return printed
#-
return str(context.getCausalityValueList())
#-
context.expand(applied_rule_id = '2308')
return "Done"
#-
for l in context.objectValues():
if l.isDivergent():
print "Divergent", l.getRelativeUrl(), str(l.getDeliveryRelatedValueList())
for c in l.objectValues():
if not c.isSimulated():
print "Not simulated", c.getRelativeUrl(), str(c.getDeliveryRelatedValueList())
elif c.isDivergent():
print "Divergent", c.getRelativeUrl(), str(c.getDeliveryRelatedValueList())
print 'OK'
return printed
#-
context.updateAppliedRule()
return "Done"
#
return context.portal_simulation.updateAssetPrice(
'assortiment/751H402_12P_H', '',
"group/Coramy",
"site/Stock_PF"
)
return context.portal_simulation.updateAssetPrice(
'composant/AN014', 'variante/composant/AN014/bronze blanc',
"group/Coramy",
"site/Stock_MP"
)
return context.portal_simulation.updateAssetPrice(
'modele/067E402', 'coloris/modele/067E402/0_noir_blanc\nmorphologie/modele/067E402/C\ntaille/adulte/48',
"group/Coramy",
"site/Stock_PF"
)
#-
context.buildInvoiceList()
return "Done"
t = context.getDefaultCausalityValue()
return t.getId()
#-
return str(context.getAggregatedAmountList(
categories = "taille/adulte/40\ncoloris/modele/058B406/2"))
#--
print context.getQLineItemList()
print context.getQColumnItemList()
print context.getQTabItemList()
print context.getVLineItemList()
print context.getVColumnItemList()
print context.getVTabItemList()
return printed
#--
return context.buildInvoiceList()
#-
return str(hasattr(context, 'inventory'))
#--
return str(context.getInventory())
#--
resource_list = context.PortalSimulation_zGetResourceList()
context.portal_simulation.commitTransaction()
commit = 100
for b in resource_list :
relative_url = b.resource_relative_url
variation_text = b.variation_text
if relative_url is not None:
if relative_url.find('modele') >= 0:
if variation_text not in (None, ''):
#print "##Calculate price for %s %s" % (b.resource_relative_url, b.variation_text)
context.portal_simulation.activate(activity='SQLQueue', priority=3).updateAssetPrice(
relative_url, variation_text,
"group/Coramy",
"site/Stock_PF"
)
else:
print "###Error variation for modele" % variation_text
commit = commit -1
if commit == 0:
context.portal_simulation.commitTransaction()
commit = 100
return printed
##
result = context.portal_simulation.updateAssetPrice(
"tissu/TI012",
"""coloris/tissu/TI012/Serenity 6025""",
"group/Coramy",
"site/Stock_MP"
)
for i in result:
print ' '.join(map(lambda x:str(x), i))
return printed
#--
result = context.portal_simulation.updateAssetPrice(
"modele/417P401",
"""coloris/modele/417P401/1_espace_stuc
taille/enfant/10 ans""",
"group/Coramy",
"site/Stock_PF"
)
for i in result:
print ' '.join(map(lambda x:str(x), i))
return printed
#-
context.restrictedTraverse("modele/537C419GLC/3").updateRelatedContent('modele/537C419GLC/2','modele/537C419GLC/3')
return 'Done'
#-
olist = context.portal_catalog(simulation_state="auto_planned", parent_uid=[context.ordre_fabrication.getUid(),context.commande_achat.getUid()])
return map(lambda x:x.path, olist)
#-
return str(context.contentValues())
modele_prix = context.restrictedTraverse('modele/417P401/pri_0_0')
modele = context.restrictedTraverse('modele/417P401')
return str(modele.getIndustrialPrice(context=context))
return str(modele_prix.test(context.asContext()))
#--
return str(context.isMemberOf('site/Piquage'))
context.restrictedTraverse('portal_simulation/3078/2').setDelivery('livraison_vente/364/1')
context.restrictedTraverse('portal_simulation/3083/2').setDelivery('livraison_vente/366/1')
return "Done"
#-
return context.buildDeliveryList()
#return context.getMovementList()
#return context.updateAppliedRule()
return len(context.Resource_zGetMovementHistoryList(resource=("modele/417P401",),
variation_text="""coloris/modele/417P401/1_espace_stuc
taille/enfant/10 ans""",
strict_membership=0,
section_category="group/Coramy",
node_category="site/Stock_PF",
simulation_state=('delivered', 'started', 'stopped', 'invoiced')))
#--------------------
for m in context.getMovementList():
if not m.isSimulated():
print "Not simumlated: %s" % m.getRelativeUrl()
return printed
#--------------------
dest = context.getDestinationValue(portal_type=['Organisation']).getTitle()
return dest
movement_list = context.getOrderRelatedMovementList()
movement_uid_list = map(lambda o:o.getUid(), movement_list)
return movement_uid_list
return map(lambda x: (x.path, x.quantity, x.target_quantity),list(context.ProductionOrder_getAggregatedMaterialConsumptionList()))
return context.updateAppliedRule()
return '/'.join(context.getPhysicalPath())
# Use this script to test if simulation state is acceptable
def hasDelivery(ps_item):
for m in ps_item.objectValues():
if len(m.getCategoryMembershipList('delivery')) > 0:
return 1
for a in m.objectValues():
if hasDelivery(a):
return 1
return 0
def getDeliveryList(ps_item):
result = {}
for m in ps_item.objectValues():
for d in m.getDeliveryValueList():
if d is not None:
result[d.getRelativeUrl()] = 1
for a in m.objectValues():
result.update( getDeliveryList(a))
return result
# ----------------------------------------------------------
# First make sure all simulation movements point to an order
print "-- Checking simulation"
for ar in context.portal_simulation.objectValues():
if ar.getCausalityValue() is None:
print " Applied Rule %s has no order" % ar.getId()
print " Previously was: %s" % ar.getCausality()
if hasDelivery(ar):
print " Applied Rule %s has some delivered movements" % ar.getId()
print " deliveries: %s" % ' '.join(getDeliveryList(ar).keys())
elif ar.getId() not in ('zero_stock', ):
print " Delete %s" % ar.getId()
context.portal_simulation.deleteContent(ar.getId())
# ----------------------------------------------------------
# Next make sure all orders in > planned state have at most one applied rule
order_list = context.ordre_fabrication.objectValues() + context.commande_achat.objectValues() + context.commande_vente.objectValues()
for of in order_list:
if of.getSimulationState() not in ('draft', 'cancelled', 'auto_planned'):
ps = of.getCausalityRelatedValueList(portal_type="Applied Rule")
if len(ps) == 0:
print " Missing PS for Order %s of type %s" % (of.getId(), of.getPortalType())
print " Reexpand order %s" % of.getId()
of.edit()
elif len(ps) > 1:
print " Too many PS for Order %s of type %s" % (of.getId(), of.getPortalType())
no_delivery = []
delivery = []
for ps_item in ps:
if hasDelivery(ps_item):
print " PS %s has some delivered movements" % ps_item.getId()
delivery.append(ps_item)
else:
print " PS %s has no delivered movements" % ps_item.getId()
no_delivery.append(ps_item)
# manage_delObjects
if len(delivery) > 0:
# Only erase no_delivery if one item has delivery
for ps_item in no_delivery:
print " Delete PS %s" % ps_item.getId()
parent = ps_item.aq_parent
parent.deleteContent(ps_item.getId())
else:
# Keep at least one
for ps_item in no_delivery[1:]:
print " Delete PS %s" % ps_item.getId()
id = ps_item.getId()
parent = ps_item.aq_parent
parent.deleteContent(ps_item.getId())
if len(delivery) > 1:
# We erase the Applied Rule but keep
# some excessive packing lists which may have been generated
# THIS BREAKS CONSISTENCY
for ps_item in delivery[1:]:
print " Delete PS %s with BREAKS CONSISTENCY" % ps_item.getId()
id = ps_item.getId()
parent = ps_item.aq_parent
parent.deleteContent(ps_item.getId())
# ----------------------------------------------------------
# Next make sure all movements in a delivery of material point to simulation
# ----------------------------------------------------------
# Next make sure all movements in a delivery of material point to simulation
return printed
## Script (Python) "testrc"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=
##title=
##
context.setSourceAdministration('person/347')
return 'Done'
# set the source administration
local_user = context.portal_membership.getAuthenticatedMember()
local_user_name = string.replace(local_user.getUserName(), '_', ' ')
local_persons = context.item_by_title_sql_search(title = local_user_name, portal_type = 'Person')
if len(local_persons) > 0:
print local_user.getUserName()
print local_persons[0].relative_url
else:
print 'couscous'
return printed
#
context.activate().buildDeliveryList()
return "Done"
"""
summary = context.getAggregatedAmountList()
#amount = summary[0]
#print amount['converted_quantity'], amount['efficiency']
print 'fin'
return printed
"""
"""
print float(context.getLaizeUtile())
return printed
"""
## Script (Python) "testseb"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=
##title=
##
delivery_list =context.object_action_list(selection_name='sales_packing_list_selection',max_nb=10)
return repr(delivery_list)
## Script (Python) "testyo"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=
##title=
##
movement_list = context.getMovementList()
movement_group = context.collectMovement(movement_list)
invoice_line_list = context.buildInvoiceLineList(movement_group)
return repr(invoice_line_list)
dict = context.showDict()
item_list = dict.items()
item_list.sort()
s = ''
for key,val in item_list:
s += "%s: %s\n" % (str(key), str(val))
return s
ret = []
invoice_line_list = context.contentValues(filter={'portal_type':'Invoice Line'})
for invoice_line in invoice_line_list:
cell_range = invoice_line.getCellRange(base_id='movement')
ret.append(cell_range)
return repr(ret)
## Script (Python) "transfer_vetement"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=
##title=
##
vetement = context
vetement_relative_url = vetement.getRelativeUrl()
related_object_list = vetement.getSpecialiseRelatedValueList()
forme = vetement.aq_parent
vetement_module = context.getPortalObject().vetement
# copy and paste vetement
copy_data = forme.manage_copyObjects(ids=[vetement.getId()])
new_id_list = vetement_module.manage_pasteObjects(copy_data)
new_vetement = vetement_module[new_id_list[0]['new_id']]
# forme_id_list is used to build the specialise relation between the vetement and formes
forme_id_list = []
forme_id_list.append(forme.getId())
# update relation on each related_object and complete forme_id_list
for related_object in related_object_list :
category_items = related_object.getCategoryList()
filtered_items = filter(lambda cat_item:cat_item.find(vetement_relative_url) == (-1) , category_items)
# print related_object.getId()
# print len(category_items)
# print len(filtered_items)
# update categories on related_object
filtered_items.append("specialise/vetement/"+vetement.getId())
related_object.edit(categories = filtered_items)
if related_object.getPortalType() == "Modele" :
modele_forme_list = related_object.getFormeIdList()
for forme_id in modele_forme_list :
if forme_id in forme_id_list :
pass
else :
forme_id_list.append(forme_id)
#print forme_id_list
# set forme_id_list on vetement
vetement_categories = new_vetement.getCategoryList()
for forme_id in forme_id_list :
vetement_categories += ('specialise/forme/'+forme_id,)
# update fichier Lectra
fichierLectra = new_vetement.getLibrairie()+'/'+new_vetement.getId()
new_vetement.edit(categories = vetement_categories, librairie = fichierLectra)
# delete old vetement
forme.deleteContent(vetement.getId())
#return printed
## Script (Python) "updateEipAndCollection"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=
##title=
##
# callable on tissu, modele, forme, gamme
categorie_dict = {}
categorie_dict['eip/Baby']=['eip/Baby']
categorie_dict['eip/Baby/Fille']=['eip/Baby/Fille']
categorie_dict['eip/Baby/Garcon']=['eip/Baby/Garcon']
categorie_dict['eip/Femme']=['eip/Femme']
categorie_dict['eip/Femme/Chic elegante']=['eip/Femme']
categorie_dict['eip/Femme/Classic']=['eip/Femme']
categorie_dict['eip/Femme/Confort']=['eip/Femme']
categorie_dict['eip/Femme/Cote azur']=['eip/Femme']
categorie_dict['eip/Femme/Maternite']=['eip/Femme']
categorie_dict['eip/Femme/Piscine']=['eip/Femme']
categorie_dict['eip/Femme/Rebelle attitude']=['eip/Femme']
categorie_dict['eip/Femme/Separables']=['eip/Femme']
categorie_dict['eip/Femme/Sportswear']=['eip/Femme']
categorie_dict['eip/Femme/Surf']=['eip/Femme']
categorie_dict['eip/Fille']=['eip/Fille']
categorie_dict['eip/Fille/Basic line']=['eip/Fille']
categorie_dict['eip/Fille/Junior']=['eip/Fille']
categorie_dict['eip/Fille/Nautic']=['eip/Fille']
categorie_dict['eip/Fille/Piscine']=['eip/Fille']
categorie_dict['eip/Fille/Pretty girl']=['eip/Fille']
categorie_dict['eip/Fille/Rayures']=['eip/Fille']
categorie_dict['eip/Fille/Surf']=['eip/Fille']
categorie_dict['eip/Garcon']=['eip/Garcon']
categorie_dict['eip/Garcon/Fantaisie']=['eip/Garcon']
categorie_dict['eip/Garcon/Junior']=['eip/Garcon']
categorie_dict['eip/Garcon/Piscine']=['eip/Garcon']
categorie_dict['eip/Garcon/Surf']=['eip/Garcon']
categorie_dict['eip/Homme']=['eip/Homme']
categorie_dict['eip/Homme/Basic']=['eip/Homme']
categorie_dict['eip/Homme/Classic']=['eip/Homme']
categorie_dict['eip/Homme/Piscine']=['eip/Homme']
categorie_dict['eip/Homme/Surf']=['eip/Homme']
categorie_dict['eip/Homme/Techno']=['eip/Homme']
old_category_list = context.getCategoryList()
new_category_list = []
categorie_keys = categorie_dict.keys()
for item in old_category_list :
if item in categorie_keys :
for cat_item in categorie_dict[item] :
if not cat_item in new_category_list :
new_category_list.append(cat_item)
else :
if not item in new_category_list and item.find('modele_origine') == -1:
new_category_list.append(item)
context.setCategoryList(new_category_list)
## Script (Python) "updateItemAggregatedMovement"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=
##title=
##
request = context.REQUEST
movement_list = context.zGetItemAggregatedMovement()
cr = '\n'
tab = '\t'
movement_log = 'Problme'+cr
for movement_item in movement_list :
movement = movement_item.getObject()
item_list = movement.getAggregateValueList()
if not item_list in ([], None) :
quantity = 0
for item in item_list :
# verify if resource of item == resource of movement
if movement.getResource() == item.getResource() :
# check if variation_category is the same
if movement.getVariationCategoryList() != item.getVariationCategoryList() :
movement_log += movement.getRelativeUrl()+tab
movement_log += str(movement.getVariationCategoryList())+tab
movement_log += item.getRelativeUrl()+tab
movement_log += str(item.getVariationCategoryList())+tab+cr
else :
movement_log += movement.getRelativeUrl()+tab
movement_log += str(movement.getVariationCategoryList())+tab
movement_log += item.getRelativeUrl()+tab
movement_log += str(item.getVariationCategoryList())+tab+cr
# verify if quantity of movement == sum (item.getRemainingQuantity)
quantity += item.getRemainingQuantity()
if 1 : # movement_MP
if (movement.getConsumptionQuantity()+movement.getProductionQuantity()) != 0 : # :
ratio = round(quantity/(movement.getConsumptionQuantity()+movement.getProductionQuantity()),0)
else :
ratio = 0
else : # livraison_fab
if movement.getTargetQuantity() !=0 :
ratio = round(quantity/movement.getTargetQuantity(),0)
else :
ratio = 0
if ratio != 1:
movement_log += movement.getRelativeUrl()+tab
movement_log += str(movement.getVariationCategoryList())+tab
#movement_log += str(movement.getTargetQuantity())+tab
movement_log += str(movement.getConsumptionQuantity()+movement.getProductionQuantity())+tab
movement_log += str(round(quantity,4))+tab+str(ratio)+cr
request.RESPONSE.setHeader('Content-Type','application/text')
return movement_log
## Script (Python) "updateQuantityOnItemAggregatedMovement"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=
##title=
##
movement = context
# initial_qty = movement.getTargetQuantity()
if movement.getPortalType() in ('Inventory Cell', 'Inventory Line') :
#if movement.getProductionQuantity() != 0.0 :
# movement.setProducedItemIdList(movement.getProducedItemIdList())
#elif movement.getConsumptionQuantity() != 0.0 :
# movement.setConsumedItemIdList(movement.getConsumedItemIdList())
#else : # inventory
movement.setItemIdList(movement.getItemIdList())
else : # Delivery Line or Cell
movement.setItemIdList(movement.getItemIdList())
# final_qty = movement.getTargetQuantity()
# return str(initial_qty-final_qty)
<dtml-comment>
title:
connection_id:MySQL
max_rows:100000
max_cache:100
cache_time:0
class_name:ZSQLBrain
class_file:zsqlbrain.py
</dtml-comment>
<params></params>
SELECT DISTINCT catalog.relative_url, catalog.id, catalog.path
FROM catalog, catalog AS delivery
LEFT JOIN category ON (catalog.uid=category.category_uid
AND category.base_category_uid = <dtml-var "portal_categories.causality.uid">
AND category.uid = delivery.uid )
WHERE ( catalog.portal_type = "Sales Order"
OR catalog.portal_type = "Purchase Order"
OR catalog.portal_type = "Production Order" )
AND ( delivery.portal_type = "Sales Packing List"
OR delivery.portal_type = "Purchase Packing List"
OR delivery.portal_type = "Production Packing List" )
AND catalog.simulation_state = "confirmed"
AND category.uid IS NULL
\ No newline at end of file
<dtml-comment>
title:
connection_id:MySQL
max_rows:100000
max_cache:100
cache_time:0
class_name:ZSQLBrain
class_file:zsqlbrain.py
</dtml-comment>
<params></params>
SELECT catalog.id, catalog.relative_url, catalog.path, category.uid
FROM catalog
LEFT JOIN category ON ( catalog.uid=category.uid
AND category.base_category_uid = <dtml-var "portal_categories.collection.uid">
AND category.category_uid = <dtml-var "portal_categories.collection['2004'].Coramy.uid">
)
WHERE not (category.uid is NULL)
AND (catalog.portal_type = "Modele"
OR catalog.portal_type = "Forme"
OR catalog.portal_type = "Tissu"
OR catalog.portal_type = "Gamme" )
AND catalog.uid = -1893100782
\ No newline at end of file
<dtml-comment>
title:
connection_id:MySQL
max_rows:100000
max_cache:100
cache_time:0
class_name:ZSQLBrain
class_file:zsqlbrain.py
</dtml-comment>
<params></params>
SELECT catalog.id, catalog.relative_url, catalog.path
FROM catalog, category
WHERE catalog.uid=category.uid
AND category.base_category_uid = <dtml-var "portal_categories.source_section.uid">
AND category.category_uid = <dtml-var "portal_categories.group.Coramy.Houvenaegel.uid">
AND ( catalog.portal_type = "Sales Order"
OR catalog.portal_type = "Sales Packing List")
<dtml-comment>
title:
connection_id:MySQL
max_rows:100000
max_cache:100
cache_time:0
class_name:ZSQLBrain
class_file:zsqlbrain.py
</dtml-comment>
<params></params>
SELECT DISTINCT catalog.relative_url, catalog.path
FROM catalog, catalog as master_item, category, stock
WHERE category.uid=stock.uid
AND category.base_category_uid = <dtml-var "portal_categories.aggregate.uid">
AND category.category_uid = catalog.uid
AND stock.node_uid = <dtml-var "portal_categories.site.Stock_MP.Gravelines.uid">
AND stock.quantity > 0
AND catalog.parent_uid = master_item.uid
AND master_item.portal_type = "Piece Tissu"
AND catalog.portal_type = "Piece Tissu"
\ No newline at end of file
<dtml-comment>
title:
connection_id:MySQL
max_rows:100000
max_cache:100
cache_time:0
class_name:ZSQLBrain
class_file:zsqlbrain.py
</dtml-comment>
<params></params>
SELECT DISTINCT catalog.id, catalog.relative_url, catalog.path
FROM catalog, catalog as tissu, catalog as delivery, category, movement
WHERE catalog.uid=category.uid
AND tissu.uid = category.category_uid
AND tissu.portal_type = "Piece Tissu"
AND category.base_category_uid = <dtml-var "portal_categories.aggregate.uid">
AND movement.uid = catalog.uid
AND delivery.uid = movement.delivery_uid
AND ( delivery.portal_type = "xProduction Packing List"
OR delivery.portal_type = "xPurchase Packing List"
OR delivery.portal_type = "Inventory MP"
OR delivery.portal_type = "xMovement MP" )
AND delivery.relative_url like "inventaire_mp/10%"
\ No newline at end of file
<dtml-comment>
title:
connection_id:MySQL
max_rows:10000
max_cache:100
cache_time:0
class_name:ZSQLBrain
class_file:zsqlbrain.py
</dtml-comment>
<params></params>
SELECT catalog.relative_url, catalog.path, catalog.id, resource.relative_url as resource, variation.relative_url as variation
FROM catalog
LEFT JOIN category ON (category.uid = catalog.uid
AND category.base_category_uid = <dtml-var "portal_categories.resource.uid">)
LEFT JOIN category as cat2 ON (cat2.uid = catalog.uid
AND cat2.base_category_uid = <dtml-var "portal_categories.coloris.uid">)
LEFT JOIN catalog as resource ON (resource.uid = category.category_uid)
LEFT JOIN catalog as variation ON (variation.uid = cat2.category_uid)
WHERE catalog.portal_type = "Piece Tissu"
AND catalog.location <> ''
AND catalog.location <> 'None'
AND not (category.uid is NULL OR cat2.uid is NULL)
\ No newline at end of file
<dtml-comment>
title:
connection_id:MySQL
max_rows:100000
max_cache:100
cache_time:0
class_name:ZSQLBrain
class_file:zsqlbrain.py
</dtml-comment>
<params></params>
SELECT DISTINCT catalog.relative_url, catalog.path
FROM catalog, catalog as resource, category
WHERE catalog.portal_type = "Piece Tissu"
AND category.uid=catalog.uid
AND category.base_category_uid = <dtml-var "portal_categories.coloris.uid">
AND category.category_uid = resource.uid
AND resource.relative_url = "tissu/TM002/blanc"
order by catalog.id
\ No newline at end of file
<dtml-comment>
title:
connection_id:MySQL
max_rows:10000
max_cache:100
cache_time:0
class_name:ZSQLBrain
class_file:zsqlbrain.py
</dtml-comment>
<params></params>
SELECT catalog.relative_url, catalog.path
FROM catalog
WHERE catalog.portal_type = "Production Packing List"
AND ( catalog.simulation_state = "started"
OR catalog.simulation_state = "stopped"
OR catalog.simulation_state = "delivered" )
\ No newline at end of file
<dtml-comment>
title:
connection_id:MySQL
max_rows:10000
max_cache:100
cache_time:0
class_name:ZSQLBrain
class_file:zsqlbrain.py
</dtml-comment>
<params></params>
SELECT
catalog.relative_url ,
movement.variation_text ,
SUM( stock.quantity ) AS inventory,
SUM( stock.total_asset_price) AS asset_price
FROM
stock
LEFT JOIN catalog ON ( catalog.uid = stock.resource_uid )
LEFT JOIN movement ON ( stock.uid = movement.uid )
WHERE
GROUP BY
stock.resource_uid , movement.variation_text
\ No newline at end of file
<dtml-comment>
title:
connection_id:MySQL
max_rows:100000
max_cache:100
cache_time:0
class_name:ZSQLBrain
class_file:zsqlbrain.py
</dtml-comment>
<params></params>
SELECT DISTINCT catalog.relative_url, catalog.path
FROM catalog, catalog as resource, catalog as delivery, movement
LEFT JOIN category
ON (category.uid=movement.uid
AND category.base_category_uid = <dtml-var "portal_categories.aggregate.uid">)
WHERE movement.uid = catalog.uid
AND movement.target_quantity <> 0
AND category.uid IS NULL
AND movement.is_accountable = 1
AND resource.uid = movement.resource_uid
AND resource.portal_type = "Tissu"
AND delivery.uid = movement.delivery_uid
AND (delivery.simulation_state = "getting_ready"
OR delivery.simulation_state = "started"
OR delivery.simulation_state = "delivered")
AND ( delivery.portal_type = "Production Packing List"
OR delivery.portal_type = "Movement MP" )
\ No newline at end of file
<dtml-comment>
title:
connection_id:MySQL
max_rows:10000
max_cache:100
cache_time:0
class_name:ZSQLBrain
class_file:zsqlbrain.py
</dtml-comment>
<params></params>
SELECT catalog.relative_url, catalog.path
FROM catalog
WHERE catalog.portal_type = "Vetement"
AND catalog.relative_url like "forme/%"
\ No newline at end of file
<dtml-comment>
title:
connection_id:MySQL
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params></params>
SELECT
item.id, stock.uid, stock.quantity, category.uid as cat_uid
FROM
catalog AS item
LEFT JOIN category
ON (category.category_uid=item.uid
AND category.base_category_uid = <dtml-var "portal_categories.aggregate.getUid()">)
LEFT JOIN stock
ON (stock.uid = category.uid
AND stock.node_uid = <dtml-var "portal_categories.site.Stock_MP.Gravelines.getUid()">
AND stock.quantity < 0
)
WHERE item.portal_type = "Piece Tissu"
AND item.id = "41347"
\ No newline at end of file
<dtml-comment>
title:
connection_id:MySQL
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params></params>
SELECT DISTINCT
count(distinct item.uid)
FROM
catalog AS item
LEFT JOIN category
ON (category.category_uid=item.uid
AND category.base_category_uid = <dtml-var "portal_categories.aggregate.getUid()">)
LEFT JOIN movement
ON (movement.uid = category.uid)
LEFT JOIN catalog AS delivery
ON (delivery.uid = movement.delivery_uid)
LEFT JOIN stock
ON (stock.uid = category.uid
AND ((stock.node_uid = <dtml-var "portal_categories.site.Stock_MP.Gravelines.getUid()">
AND stock.quantity < 0)
OR (delivery.portal_type <> "Production Packing List" AND delivery.portal_type <> "Movement MP" )))
WHERE item.portal_type = "Piece Tissu"
AND stock.uid IS NULL
\ No newline at end of file
<dtml-comment>
title:
connection_id:MySQL
max_rows:1000
max_cache:100
cache_time:0
class_name:ZSQLBrain
class_file:zsqlbrain.py
</dtml-comment>
<params>sort_on
resource_id_list=""
variante_id_list=""
id
default_source_title
default_source_reference</params>
SELECT DISTINCT
item.uid, item.id, item.path, item.Description, item.simulation_state, item.default_destination_title
FROM
catalog AS item
<dtml-if expr="_.len(resource_id_list)>0">
, catalog AS resource
, category AS cat1
</dtml-if>
<dtml-if expr="_.len(variante_id_list)>0">
, catalog as variante
, category AS cat2
</dtml-if>
LEFT JOIN category
ON (category.category_uid=item.uid
AND category.base_category_uid = <dtml-var "portal_categories.aggregate.getUid()">)
LEFT JOIN stock
ON (stock.uid = category.uid)
WHERE
item.portal_type = "Piece Tissu"
AND stock.node_uid = <dtml-var "portal_categories.site.Stock_MP.Gravelines.getUid()">
AND stock.quantity > 0
<dtml-in PieceTissu_searchConsumedList>AND item.uid <> <dtml-sqlvar uid type="int">
</dtml-in>
<dtml-if expr="_.len(resource_id_list)>0">
AND ( resource.id LIKE "<dtml-var expr="resource_id_list[0]">"
<dtml-in prefix="loop" expr="_.range(_.len(resource_id_list)-1)">
OR resource.id LIKE "<dtml-var expr="resource_id_list[loop_item+1]">"
</dtml-in>
)
AND cat1.uid=item.uid
AND cat1.category_uid=resource.uid
AND cat1.base_category_uid=<dtml-var "portal_categories.resource.uid">
</dtml-if>
<dtml-if expr="_.len(variante_id_list)>0">
AND ( variante.id LIKE "<dtml-var expr="variante_id_list[0]">"
<dtml-in prefix="loop" expr="_.range(_.len(variante_id_list)-1)">
OR variante.id LIKE "<dtml-var expr="variante_id_list[loop_item+1]">"
</dtml-in>
)
AND cat2.uid=item.uid
AND cat2.category_uid=variante.uid
AND cat2.base_category_uid=<dtml-var "portal_categories.coloris.uid">
</dtml-if>
<dtml-if id>
AND item.id LIKE <dtml-sqlvar id type="string">
</dtml-if>
<dtml-if default_source_title>
AND item.default_source_title LIKE <dtml-sqlvar default_source_title type="string">
</dtml-if>
<dtml-if default_source_reference>
AND item.default_source_reference LIKE <dtml-sqlvar default_source_reference type="string">
</dtml-if>
<dtml-if sort_on>ORDER BY
<dtml-var sort_on>
</dtml-if>
\ No newline at end of file
<dtml-comment>
title:
connection_id:MySQL
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params></params>
SELECT DISTINCT
count(distinct item.uid)
FROM
catalog AS item
LEFT JOIN category
ON (category.category_uid=item.uid
AND category.base_category_uid = <dtml-var "portal_categories.aggregate.getUid()">)
LEFT JOIN stock
ON (stock.uid = category.uid
AND stock.node_uid = <dtml-var "portal_categories.site.Stock_MP.Gravelines.getUid()">
AND stock.quantity < 0)
WHERE item.portal_type = "Piece Tissu"
AND category.uid IS NULL
AND item.id = "41347"
\ No newline at end of file
<dtml-comment>
title:
connection_id:MySQL
max_rows:1000
max_cache:100
cache_time:0
class_name:ZSQLBrain
class_file:zsqlbrain.py
</dtml-comment>
<params></params>
SELECT DISTINCT
count(distinct item.uid)
FROM
catalog AS item
LEFT JOIN category
ON (category.category_uid=item.uid
AND category.base_category_uid = <dtml-var "portal_categories.aggregate.getUid()">)
LEFT JOIN stock
ON (stock.uid = category.uid
AND stock.node_uid = <dtml-var "portal_categories.site.Stock_MP.Gravelines.getUid()">
AND stock.quantity < 0)
LEFT JOIN stock AS stock_catalog
ON (stock.uid = stock_catalog.uid)
LEFT JOIN category AS other_category
ON (other_category.category_uid=item.uid
AND other_category.base_category_uid = <dtml-var "portal_categories.aggregate.getUid()">
AND other_category.uid <> category.uid)
LEFT JOIN stock AS other_stock
ON (other_stock.uid = other_category.uid
AND NOT (other_stock.node_uid = <dtml-var "portal_categories.site.Stock_MP.Gravelines.getUid()">
AND other_stock.quantity < 0))
LEFT JOIN category AS other_category2
ON (other_category2.category_uid=item.uid
AND other_category2.base_category_uid = <dtml-var "portal_categories.aggregate.getUid()">
AND other_category2.uid <> category.uid
AND other_category2.uid <> other_category.uid)
LEFT JOIN stock AS other_stock2
ON (other_stock2.uid = other_category.uid
AND NOT (other_stock2.node_uid = <dtml-var "portal_categories.site.Stock_MP.Gravelines.getUid()">
AND other_stock2.quantity < 0))
WHERE item.portal_type = "Piece Tissu"
AND stock_catalog.uid IS NULL
AND other_stock.uid IS NULL
AND other_stock2.uid IS NULL
<dtml-comment>
title:
connection_id:MySQL
max_rows:1000
max_cache:100
cache_time:0
class_name:ZSQLBrain
class_file:zsqlbrain.py
</dtml-comment>
<params></params>
SELECT DISTINCT
count(distinct item.uid)
FROM
catalog AS item
LEFT JOIN category
ON (category.category_uid=item.uid
AND category.base_category_uid = <dtml-var "portal_categories.aggregate.getUid()">)
LEFT JOIN stock
ON (stock.uid = category.uid
AND stock.node_uid = <dtml-var "portal_categories.site.Stock_MP.Gravelines.getUid()">
AND stock.quantity < 0)
LEFT JOIN category AS other_category
ON (other_category.category_uid=item.uid
AND other_category.base_category_uid = <dtml-var "portal_categories.aggregate.getUid()">
AND category.uid <> other_category.uid)
LEFT JOIN stock AS other_stock
ON (other_stock.uid = other_category.uid
AND other_stock.node_uid = <dtml-var "portal_categories.site.Stock_MP.Gravelines.getUid()">
AND other_stock.quantity < 0)
LEFT JOIN category AS other_category2
ON (other_category.category_uid=item.uid
AND other_category.base_category_uid = <dtml-var "portal_categories.aggregate.getUid()">
AND category.uid <> other_category2.uid
AND other_category.uid <> other_category2.uid)
LEFT JOIN stock AS other_stock2
ON (other_stock2.uid = other_category2.uid
AND other_stock2.node_uid = <dtml-var "portal_categories.site.Stock_MP.Gravelines.getUid()">
AND other_stock2.quantity < 0)
WHERE item.portal_type = "Piece Tissu"
AND stock.uid IS NULL
AND other_stock.uid IS NULL
AND other_stock2.uid IS NULL
<dtml-comment>
title:
connection_id:MySQL
max_rows:1000
max_cache:100
cache_time:0
class_name:DeliveryListBrain
class_file:InventoryBrain.py
</dtml-comment>
<params>simulation_state:list
target_start_date
target_stop_date
query
node_title
resource_title
variation_text
sort_on
resource_tree</params>
SELECT
SUM(movement.target_quantity) as target_quantity,
movement.variation_text AS variation_text,
node.title AS node_title,
resource.title AS resource_title,
resource.uid AS resource_uid,
resource.relative_url AS resource_relative_url,
movement.target_start_date AS target_start_date,
movement.target_stop_date AS target_stop_date
<dtml-if query>, <dtml-sqlvar query type="string"> AS query </dtml-if>
FROM
catalog, movement, catalog AS resource, catalog AS node, catalog AS delivery <dtml-if query>, category </dtml-if>
WHERE
catalog.uid = movement.uid
AND movement.has_cell_content = 0
AND node.uid = movement.source_uid
AND movement.delivery_uid = delivery.uid
AND movement.target_quantity <> 0.0
AND delivery.portal_type = "Purchase Order"
AND movement.resource_uid = resource.uid
<dtml-if simulation_state> AND (<dtml-in simulation_state> catalog.simulation_state = <dtml-sqlvar sequence-item type="string"><dtml-if sequence-end><dtml-else> OR </dtml-if></dtml-in>)
</dtml-if><dtml-if target_start_date> AND movement.target_start_date < <dtml-sqlvar target_start_date type="string">
</dtml-if><dtml-if target_stop_date> AND movement.target_stop_date < <dtml-sqlvar target_stop_date type="string">
</dtml-if><dtml-if query> AND <dtml-if resource_tree>resource.uid = category.uid <dtml-else>movement.destination_uid = category.uid </dtml-if>
AND <dtml-var query>
</dtml-if><dtml-if node_title>AND node.title LIKE '%<dtml-var node_title>%'
</dtml-if><dtml-if resource_title>AND resource.title LIKE '%<dtml-var resource_title>%'
</dtml-if><dtml-if variation_text>AND variation_text LIKE '%<dtml-var variation_text>%'
</dtml-if>
GROUP BY
movement.resource_uid, movement.variation_text
<dtml-if sort_on>
ORDER BY
<dtml-var sort_on>
<dtml-else>
ORDER BY
movement.target_stop_date
</dtml-if>
\ No newline at end of file
<dtml-comment>
title:
connection_id:MySQL
max_rows:1000
max_cache:100
cache_time:0
class_name:ZSQLBrain
class_file:zsqlbrain.py
</dtml-comment>
<params>state_list=""
group_list=""
sort_on</params>
SELECT DISTINCT catalog.id, catalog.uid, catalog.relative_url, catalog.path, catalog.Description, catalog.simulation_state, catalog.default_destination_title
FROM catalog
<dtml-if expr="_.len(group_list)>0 and not ('' in group_list)">
, catalog AS organigramme
, category AS cat1
</dtml-if>
<dtml-if expr="_.len(group_list)>0 and '' in group_list">
LEFT JOIN category AS cat2 ON (cat2.uid=catalog.uid
AND cat2.base_category_uid=<dtml-var "portal_categories.group.uid">)
</dtml-if>
WHERE catalog.portal_type = "Sales Order"
<dtml-if expr="_.len(group_list)>0 and not ('' in group_list)">
AND ( organigramme.title LIKE "<dtml-var expr="group_list[0]">"
<dtml-in prefix="loop" expr="_.range(_.len(group_list)-1)">
OR organigramme.title LIKE "<dtml-var expr="group_list[loop_item+1]">"
</dtml-in>
)
AND cat1.uid=catalog.uid
AND cat1.category_uid=organigramme.uid
AND cat1.base_category_uid=<dtml-var "portal_categories.group.uid">
</dtml-if>
<dtml-if expr="_.len(state_list)>0">
AND ( catalog.simulation_state = "<dtml-var expr="state_list[0]">"
<dtml-in prefix="loop" expr="_.range(_.len(state_list)-1)">
OR catalog.simulation_state = "<dtml-var expr="state_list[loop_item+1]">"
</dtml-in>
)
</dtml-if>
<dtml-if expr="_.len(group_list)>0 and '' in group_list">
AND cat2.uid IS NULL
</dtml-if>
<dtml-if sort_on>
ORDER BY <dtml-var sort_on>
</dtml-if>
\ No newline at end of file
<dtml-comment>
title:
connection_id:MySQL
max_rows:1000
max_cache:100
cache_time:0
class_name:ZSQLBrain
class_file:zsqlbrain.py
</dtml-comment>
<params>state_list=""
group_list=""
sort_on</params>
SELECT DISTINCT catalog.id, catalog.uid, catalog.relative_url, catalog.path, catalog.Description, catalog.simulation_state, catalog.default_destination_title
FROM catalog, catalog AS catalog_order, category AS category_order
<dtml-if expr="_.len(group_list)>0 and not ('' in group_list)">
, catalog AS organigramme
, category AS cat1
</dtml-if>
<dtml-if expr="_.len(group_list)>0 and '' in group_list">
LEFT JOIN category AS cat2 ON (cat2.uid=order_catalog.uid
AND cat2.base_category_uid=<dtml-var "portal_categories.group.uid">)
</dtml-if>
WHERE catalog.portal_type = "Sales Packing List"
AND category_order.uid = catalog.uid
AND category_order.base_category_uid=<dtml-var "portal_categories.causality.uid">
AND category_order.category_uid = catalog_order.uid
AND catalog_order.portal_type = "Sales Order"
<dtml-if expr="_.len(group_list)>0 and not ('' in group_list)">
AND ( organigramme.title LIKE "<dtml-var expr="group_list[0]">"
<dtml-in prefix="loop" expr="_.range(_.len(group_list)-1)">
OR organigramme.title LIKE "<dtml-var expr="group_list[loop_item+1]">"
</dtml-in>
)
AND cat1.uid=catalog_order.uid
AND cat1.category_uid=organigramme.uid
AND cat1.base_category_uid=<dtml-var "portal_categories.group.uid">
</dtml-if>
<dtml-if expr="_.len(state_list)>0">
AND ( catalog.simulation_state = "<dtml-var expr="state_list[0]">"
<dtml-in prefix="loop" expr="_.range(_.len(state_list)-1)">
OR catalog.simulation_state = "<dtml-var expr="state_list[loop_item+1]">"
</dtml-in>
)
</dtml-if>
<dtml-if expr="_.len(group_list)>0 and '' in group_list">
AND cat2.uid IS NULL
</dtml-if>
<dtml-if sort_on>
ORDER BY <dtml-var sort_on>
</dtml-if>
\ No newline at end of file
<?xml version="1.0" encoding="iso-8859-1"?>
<form>
<title>Productions</title>
<name>ProductionOrder_inventoryView</name>
<action></action>
<enctype></enctype>
<method>POST</method>
<pt>form_view</pt>
<groups>
<group>
<title>left</title>
<fields>
<field><id>my_id</id> <type>StringField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default></default>
<description></description>
<display_maxwidth></display_maxwidth>
<display_width type="int">20</display_width>
<external_validator></external_validator>
<extra></extra>
<hidden type="int">0</hidden>
<max_length></max_length>
<required type="int">1</required>
<title>Id</title>
<truncate type="int">0</truncate>
</values>
<tales>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="too_long">Too much input was given.</message>
</messages>
</field>
</fields>
</group>
<group>
<title>right</title>
<fields>
</fields>
</group>
<group>
<title>center</title>
<fields>
</fields>
</group>
<group>
<title>bottom</title>
<fields>
<field><id>listbox</id> <type>ListBox</type>
<values>
<all_columns type="list">[]</all_columns>
<all_editable_columns type="list">[]</all_editable_columns>
<alternate_name></alternate_name>
<columns type="list">[('node_title', 'Stock'), ('section_title', 'Propri\xe9taire'), ('resource_relative_url', 'Composant'), ('variation_text', 'Variante'), ('quantity', 'Qt\xe9'), ('getCurrentInventory', 'Stock'), ('getAvailableInventory', 'Dispo'), ('getFutureInventory', 'Futur'), ('getQuantityUnit', 'Unit\xe9')]</columns>
<css_class></css_class>
<default></default>
<default_params type="list">[]</default_params>
<description></description>
<domain_root_list type="list">[('portal_categories/site/Stock_MP', 'Stocks MP'), ('portal_categories/site', 'Sites')]</domain_root_list>
<domain_tree type="int">0</domain_tree>
<editable_columns type="list">[]</editable_columns>
<external_validator></external_validator>
<global_attributes type="list">[]</global_attributes>
<hidden type="int">0</hidden>
<lines type="int">20</lines>
<list_action>Resource_inventoryView</list_action>
<list_method type="method">ProductionOrder_getAggregatedMaterialProductionList</list_method>
<meta_types type="list">[]</meta_types>
<portal_types type="list">[]</portal_types>
<report_root_list type="list">[]</report_root_list>
<report_tree type="int">0</report_tree>
<search type="int">0</search>
<search_columns type="list">[]</search_columns>
<select type="int">0</select>
<selection_name>resource_current_inventory</selection_name>
<sort type="list">[]</sort>
<stat_method></stat_method>
<title>Productions</title>
</values>
<tales>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
</messages>
</field>
<field><id>current_inventory_chart</id> <type>ZGDChart</type>
<values>
<alternate_name></alternate_name>
<bg_transparent type="int">1</bg_transparent>
<chart_style>line_2d</chart_style>
<chart_title>Prvisions</chart_title>
<css_class></css_class>
<data_method>getInventoryHistoryChart</data_method>
<default></default>
<default_params type="list">[]</default_params>
<description></description>
<external_validator></external_validator>
<hidden type="int">0</hidden>
<selection_name>resource_current_inventory_chart</selection_name>
<title>Prvisions</title>
<x_title></x_title>
<y_title></y_title>
</values>
<tales>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
</messages>
</field>
</fields>
</group>
<group>
<title>hidden</title>
<fields>
</fields>
</group>
</groups>
</form>
\ No newline at end of file
<?xml version="1.0" encoding="iso-8859-1"?>
<form>
<title>Liste des ordres de conditionnement</title>
<name>PackingOrder_list</name>
<action></action>
<enctype>multipart/form-data</enctype>
<method>POST</method>
<pt>form_list</pt>
<groups>
<group>
<title>Default</title>
<fields>
<field><id>listbox</id> <type>ListBox</type>
<values>
<all_columns type="list">[('id', 'OC'), ('Description', 'Description'), ('default_destination_section_title', 'Soci\xe9t\xe9'), ('default_source_title', 'Produit par'), ('default_destination_title', 'Livrer \xe0'), ('target_stop_date', 'Date livraison'), ('simulation_state', 'Etat'), ('discussion_state', 'Discussion')]</all_columns>
<all_editable_columns type="list">[]</all_editable_columns>
<alternate_name></alternate_name>
<columns type="list">[('id', 'OC'), ('Description', 'Description'), ('default_destination_section_title', 'Soci\xe9t\xe9'), ('default_source_title', 'Produit par'), ('default_destination_title', 'Livrer \xe0'), ('target_stop_date', 'Date livraison'), ('simulation_state', 'Etat'), ('discussion_state', 'Discussion')]</columns>
<css_class></css_class>
<default></default>
<default_params type="list">[('id', "''")]</default_params>
<description></description>
<domain_root_list type="list">[]</domain_root_list>
<domain_tree type="int">0</domain_tree>
<editable_columns type="list">[]</editable_columns>
<external_validator></external_validator>
<global_attributes type="list">[]</global_attributes>
<hidden type="int">0</hidden>
<lines type="int">30</lines>
<list_action>list</list_action>
<list_method type="method">portal_catalog</list_method>
<meta_types type="list">[]</meta_types>
<portal_types type="list">[('Packing Order', 'Packing Order')]</portal_types>
<report_root_list type="list">[]</report_root_list>
<report_tree type="int">0</report_tree>
<search type="int">1</search>
<search_columns type="list">[]</search_columns>
<select type="int">1</select>
<selection_name>packing_order_selection</selection_name>
<sort type="list">[('id', 'id')]</sort>
<stat_method></stat_method>
<title>Ordres de conditionnement</title>
</values>
<tales>
<list_method>python:here.getPortalObject().portal_skins.local_list_method[here.REQUEST.list_method_id]</list_method>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
</messages>
</field>
</fields>
</group>
</groups>
</form>
\ No newline at end of file
<?xml version="1.0" encoding="iso-8859-1"?>
<form>
<title>Ordre de conditionnement</title>
<name>PackingOrder_view</name>
<action>base_edit</action>
<enctype></enctype>
<method>POST</method>
<pt>form_view</pt>
<groups>
<group>
<title>left</title>
<fields>
<field><id>my_id</id> <type>StringField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default></default>
<description></description>
<display_maxwidth></display_maxwidth>
<display_width type="int">10</display_width>
<external_validator></external_validator>
<extra></extra>
<hidden type="int">0</hidden>
<max_length></max_length>
<required type="int">1</required>
<title>Ordre de fabrication</title>
<truncate type="int">0</truncate>
</values>
<tales>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="too_long">Too much input was given.</message>
</messages>
</field>
<field><id>my_destination_section</id> <type>ListField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default></default>
<description></description>
<external_validator></external_validator>
<extra></extra>
<first_item type="int">0</first_item>
<hidden type="int">0</hidden>
<items type="list">[]</items>
<required type="int">0</required>
<size type="int">1</size>
<title>Socit</title>
</values>
<tales>
<items>python:here.portal_categories.group.Coramy.getCategoryChildIdItemList(base=1,display_none_category=1)</items>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="unknown_selection">You selected an item that was not in the list.</message>
</messages>
</field>
<field><id>my_description</id> <type>TextAreaField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default></default>
<description></description>
<external_validator></external_validator>
<extra></extra>
<height type="int">3</height>
<hidden type="int">0</hidden>
<max_length></max_length>
<max_linelength></max_linelength>
<max_lines></max_lines>
<required type="int">0</required>
<title>Description</title>
<width type="int">40</width>
</values>
<tales>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="too_many_lines">You entered too many lines.</message>
<message name="line_too_long">A line was too long.</message>
<message name="too_long">You entered too many characters.</message>
</messages>
</field>
<field><id>my_date_emission</id> <type>DateTimeField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<date_only type="int">1</date_only>
<date_separator>/</date_separator>
<default_now type="int">0</default_now>
<description></description>
<external_validator></external_validator>
<hidden type="int">0</hidden>
<input_order>dmy</input_order>
<input_style>text</input_style>
<required type="int">0</required>
<time_separator>:</time_separator>
<title>OC mis le</title>
</values>
<tales>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="not_datetime">You did not enter a valid date and time.</message>
<message name="datetime_out_of_range">The date and time you entered were out of range.</message>
</messages>
</field>
<field><id>my_commande_origine</id> <type>ListField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default></default>
<description></description>
<external_validator></external_validator>
<extra></extra>
<first_item type="int">0</first_item>
<hidden type="int">0</hidden>
<items type="list">[]</items>
<required type="int">0</required>
<size type="int">1</size>
<title>Support de l'OC</title>
</values>
<tales>
<items>here/portal_categories/commande_origine/getFormItemList</items>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="unknown_selection">You selected an item that was not in the list.</message>
</messages>
</field>
<field><id>my_destination_administration_person_title</id> <type>RelationStringField</type>
<values>
<alternate_name></alternate_name>
<base_category>destination_administration</base_category>
<catalog_index>Title</catalog_index>
<css_class></css_class>
<default></default>
<default_module>person</default_module>
<description></description>
<display_maxwidth></display_maxwidth>
<display_width type="int">20</display_width>
<external_validator></external_validator>
<extra></extra>
<hidden type="int">0</hidden>
<jump_method>base_jump_relation</jump_method>
<max_length></max_length>
<portal_type type="list">[('Person', 'Person')]</portal_type>
<required type="int">0</required>
<title>Gestionaire</title>
<truncate type="int">0</truncate>
<update_method>base_update_relation</update_method>
</values>
<tales>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="too_long">Too much input was given.</message>
</messages>
</field>
<field><id>my_price_currency</id> <type>ListField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default></default>
<description></description>
<external_validator></external_validator>
<extra></extra>
<first_item type="int">0</first_item>
<hidden type="int">0</hidden>
<items type="list">[]</items>
<required type="int">0</required>
<size type="int">1</size>
<title>Devise</title>
</values>
<tales>
<items>python:[('','')]+map(lambda x:(x.id,'devise/%s' %x.id),here.devise.objectValues())</items>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="unknown_selection">You selected an item that was not in the list.</message>
</messages>
</field>
<field><id>my_incoterm</id> <type>ListField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default></default>
<description></description>
<external_validator></external_validator>
<extra></extra>
<first_item type="int">0</first_item>
<hidden type="int">0</hidden>
<items type="list">[]</items>
<required type="int">0</required>
<size type="int">1</size>
<title>Incoterm</title>
</values>
<tales>
<items>python:here.portal_categories.incoterm.getCategoryChildItemList(display_id = 'getTitle', display_none_category=1)</items>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="unknown_selection">You selected an item that was not in the list.</message>
</messages>
</field>
<field><id>my_delivery_mode</id> <type>ListField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default></default>
<description></description>
<external_validator></external_validator>
<extra></extra>
<first_item type="int">0</first_item>
<hidden type="int">0</hidden>
<items type="list">[]</items>
<required type="int">0</required>
<size type="int">1</size>
<title>Mode de livraison</title>
</values>
<tales>
<items>here/portal_categories/delivery_mode/getFormItemList</items>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="unknown_selection">You selected an item that was not in the list.</message>
</messages>
</field>
</fields>
</group>
<group>
<title>right</title>
<fields>
<field><id>my_source_title</id> <type>RelationStringField</type>
<values>
<alternate_name></alternate_name>
<base_category>source</base_category>
<catalog_index>Title</catalog_index>
<css_class></css_class>
<default></default>
<default_module>organisation</default_module>
<description></description>
<display_maxwidth></display_maxwidth>
<display_width type="int">20</display_width>
<external_validator></external_validator>
<extra></extra>
<hidden type="int">0</hidden>
<jump_method>base_jump_relation</jump_method>
<max_length></max_length>
<portal_type type="list">[('Organisation', 'Organisation'), ('Category', 'Category')]</portal_type>
<required type="int">0</required>
<title>Produit par</title>
<truncate type="int">0</truncate>
<update_method>base_update_relation</update_method>
</values>
<tales>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="too_long">Too much input was given.</message>
</messages>
</field>
<field><id>my_source_administration_title</id> <type>RelationStringField</type>
<values>
<alternate_name></alternate_name>
<base_category>source_administration</base_category>
<catalog_index>Title</catalog_index>
<css_class></css_class>
<default></default>
<default_module>person</default_module>
<description></description>
<display_maxwidth></display_maxwidth>
<display_width type="int">20</display_width>
<external_validator></external_validator>
<extra></extra>
<hidden type="int">0</hidden>
<jump_method>base_jump_relation</jump_method>
<max_length></max_length>
<portal_type type="list">[('Person', 'Person'), ('Organisation', 'Organisation'), ('Category', 'Category')]</portal_type>
<required type="int">0</required>
<title>Contact</title>
<truncate type="int">0</truncate>
<update_method>base_update_relation</update_method>
</values>
<tales>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="too_long">Too much input was given.</message>
</messages>
</field>
<field><id>my_destination_title</id> <type>RelationStringField</type>
<values>
<alternate_name></alternate_name>
<base_category>destination</base_category>
<catalog_index>Title</catalog_index>
<css_class></css_class>
<default></default>
<default_module>organisation</default_module>
<description></description>
<display_maxwidth></display_maxwidth>
<display_width type="int">20</display_width>
<external_validator></external_validator>
<extra></extra>
<hidden type="int">0</hidden>
<jump_method>base_jump_relation</jump_method>
<max_length></max_length>
<portal_type type="list">[('Organisation', 'Organisation'), ('Category', 'Category')]</portal_type>
<required type="int">0</required>
<title>Livrer </title>
<truncate type="int">0</truncate>
<update_method>base_update_relation</update_method>
</values>
<tales>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="too_long">Too much input was given.</message>
</messages>
</field>
<field><id>my_target_start_date</id> <type>DateTimeField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<date_only type="int">1</date_only>
<date_separator>/</date_separator>
<default_now type="int">0</default_now>
<description></description>
<external_validator></external_validator>
<hidden type="int">0</hidden>
<input_order>dmy</input_order>
<input_style>text</input_style>
<required type="int">0</required>
<time_separator>:</time_separator>
<title>Date de coupe demande</title>
</values>
<tales>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="not_datetime">You did not enter a valid date and time.</message>
<message name="datetime_out_of_range">The date and time you entered were out of range.</message>
</messages>
</field>
<field><id>my_target_stop_date</id> <type>DateTimeField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<date_only type="int">1</date_only>
<date_separator>/</date_separator>
<default_now type="int">0</default_now>
<description></description>
<external_validator></external_validator>
<hidden type="int">0</hidden>
<input_order>dmy</input_order>
<input_style>text</input_style>
<required type="int">0</required>
<time_separator>:</time_separator>
<title>Date de livraison demande</title>
</values>
<tales>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="not_datetime">You did not enter a valid date and time.</message>
<message name="datetime_out_of_range">The date and time you entered were out of range.</message>
</messages>
</field>
<field><id>spacer</id> <type>StringField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default></default>
<description></description>
<display_maxwidth></display_maxwidth>
<display_width type="int">20</display_width>
<external_validator></external_validator>
<extra></extra>
<hidden type="int">1</hidden>
<max_length></max_length>
<required type="int">0</required>
<title></title>
<truncate type="int">0</truncate>
</values>
<tales>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="too_long">Too much input was given.</message>
</messages>
</field>
<field><id>my_start_date</id> <type>DateTimeField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<date_only type="int">1</date_only>
<date_separator>/</date_separator>
<default_now type="int">0</default_now>
<description></description>
<external_validator></external_validator>
<hidden type="int">0</hidden>
<input_order>dmy</input_order>
<input_style>text</input_style>
<required type="int">0</required>
<time_separator>:</time_separator>
<title>Date de coupe confirme</title>
</values>
<tales>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="not_datetime">You did not enter a valid date and time.</message>
<message name="datetime_out_of_range">The date and time you entered were out of range.</message>
</messages>
</field>
<field><id>my_stop_date</id> <type>DateTimeField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<date_only type="int">1</date_only>
<date_separator>/</date_separator>
<default_now type="int">0</default_now>
<description></description>
<external_validator></external_validator>
<hidden type="int">0</hidden>
<input_order>dmy</input_order>
<input_style>text</input_style>
<required type="int">0</required>
<time_separator>:</time_separator>
<title>Date de livraison confirme</title>
</values>
<tales>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="not_datetime">You did not enter a valid date and time.</message>
<message name="datetime_out_of_range">The date and time you entered were out of range.</message>
</messages>
</field>
<field><id>order_state</id> <type>StringField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default></default>
<description></description>
<display_maxwidth></display_maxwidth>
<display_width type="int">20</display_width>
<external_validator></external_validator>
<extra></extra>
<hidden type="int">0</hidden>
<max_length></max_length>
<required type="int">0</required>
<title>Etat</title>
<truncate type="int">0</truncate>
</values>
<tales>
<default>python:here.portal_workflow.getInfoFor(here, 'simulation_state')</default>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="too_long">Too much input was given.</message>
</messages>
</field>
<field><id>discussion_state</id> <type>StringField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default></default>
<description></description>
<display_maxwidth></display_maxwidth>
<display_width type="int">20</display_width>
<external_validator></external_validator>
<extra></extra>
<hidden type="int">0</hidden>
<max_length></max_length>
<required type="int">0</required>
<title>Discussion</title>
<truncate type="int">0</truncate>
</values>
<tales>
<default>python:here.portal_workflow.getInfoFor(here, 'discussion_state')</default>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="too_long">Too much input was given.</message>
</messages>
</field>
<field><id>my_trade_condition_title</id> <type>RelationStringField</type>
<values>
<alternate_name></alternate_name>
<base_category>specialise</base_category>
<catalog_index>Title</catalog_index>
<css_class></css_class>
<default></default>
<default_module>condition_achat</default_module>
<description></description>
<display_maxwidth></display_maxwidth>
<display_width type="int">20</display_width>
<external_validator></external_validator>
<extra></extra>
<hidden type="int">0</hidden>
<jump_method>base_jump_relation</jump_method>
<max_length></max_length>
<portal_type type="list">[('Condition Achat', 'Condition Achat')]</portal_type>
<required type="int">0</required>
<title>Condition d'achat</title>
<truncate type="int">0</truncate>
<update_method>base_update_relation</update_method>
</values>
<tales>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="too_long">Too much input was given.</message>
</messages>
</field>
</fields>
</group>
<group>
<title>center</title>
<fields>
<field><id>my_comment</id> <type>TextAreaField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default></default>
<description></description>
<external_validator></external_validator>
<extra></extra>
<height type="int">3</height>
<hidden type="int">0</hidden>
<max_length></max_length>
<max_linelength></max_linelength>
<max_lines></max_lines>
<required type="int">0</required>
<title>Commentaires</title>
<width type="int">80</width>
</values>
<tales>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="too_many_lines">You entered too many lines.</message>
<message name="line_too_long">A line was too long.</message>
<message name="too_long">You entered too many characters.</message>
</messages>
</field>
<field><id>my_total_quantity</id> <type>FloatField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default></default>
<description></description>
<display_maxwidth></display_maxwidth>
<display_width type="int">10</display_width>
<external_validator></external_validator>
<extra></extra>
<hidden type="int">1</hidden>
<required type="int">0</required>
<title>Quantit totale</title>
</values>
<tales>
<title>python:'Quantit totale : %.2f' % here.getTargetTotalQuantity()</title>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="not_float">You did not enter a floating point number.</message>
</messages>
</field>
<field><id>my_total_duration</id> <type>FloatField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default></default>
<description></description>
<display_maxwidth></display_maxwidth>
<display_width type="int">10</display_width>
<external_validator></external_validator>
<extra></extra>
<hidden type="int">1</hidden>
<required type="int">0</required>
<title>Dure totale</title>
</values>
<tales>
<title>python:'Dure totale (h) : %.2f' % here.ProductionOrder_getTotalDuration()</title>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="not_float">You did not enter a floating point number.</message>
</messages>
</field>
</fields>
</group>
<group>
<title>bottom</title>
<fields>
<field><id>listbox</id> <type>ListBox</type>
<values>
<all_columns type="list">[('id', 'Ligne n\xb0'), ('resource_title', 'Produit'), ('ProductionOrderLine_getResourceState', 'Etat produit'), ('ProductionOrderLine_getResourceAccord', 'Accord technique'), ('ProductionOrderLine_getResourceInfosClient', 'Infos client'), ('total_quantity', 'Quantit\xe9 totale'), ('quantity_unit', 'Unit\xe9'), ('total_price', 'Montant total'), ('target_stop_date', 'Date livraison')]</all_columns>
<all_editable_columns type="list">[('quantity_unit', 'Unit')]</all_editable_columns>
<alternate_name></alternate_name>
<columns type="list">[('id', 'Ligne n\xb0'), ('resource_title', 'Produit'), ('ProductionOrderLine_getResourceState', 'Etat produit'), ('ProductionOrderLine_getResourceAccord', 'Accord technique'), ('ProductionOrderLine_getResourceInfosClient', 'Infos client'), ('total_quantity', 'Quantit\xe9 totale'), ('quantity_unit', 'Unit\xe9'), ('total_price', 'Montant total'), ('target_stop_date', 'Date livraison')]</columns>
<css_class></css_class>
<default></default>
<default_params type="list">[]</default_params>
<description></description>
<domain_root_list type="list">[]</domain_root_list>
<domain_tree type="int">0</domain_tree>
<editable_columns type="list">[('quantity_unit', 'Unit')]</editable_columns>
<external_validator></external_validator>
<global_attributes type="list">[]</global_attributes>
<hidden type="int">0</hidden>
<lines type="int">10</lines>
<list_action>list</list_action>
<list_method type="method">searchFolder</list_method>
<meta_types type="list">[]</meta_types>
<portal_types type="list">[('Packing Order Line', 'Packing Order Line')]</portal_types>
<report_root_list type="list">[]</report_root_list>
<report_tree type="int">0</report_tree>
<search type="int">0</search>
<search_columns type="list">[]</search_columns>
<select type="int">0</select>
<selection_name>purchase_order_line_selection</selection_name>
<sort type="list">[('id', 'id')]</sort>
<stat_method></stat_method>
<title>Lignes d'OC</title>
</values>
<tales>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
</messages>
</field>
</fields>
</group>
<group>
<title>hidden</title>
<fields>
<field><id>listbox_quantity</id> <type>FloatField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default></default>
<description></description>
<display_maxwidth></display_maxwidth>
<display_width type="int">10</display_width>
<external_validator></external_validator>
<extra></extra>
<hidden type="int">0</hidden>
<required type="int">0</required>
<title>Quantit</title>
</values>
<tales>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="not_float">You did not enter a floating point number.</message>
</messages>
</field>
<field><id>listbox_quantity_unit</id> <type>ListField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default></default>
<description></description>
<external_validator></external_validator>
<extra></extra>
<first_item type="int">0</first_item>
<hidden type="int">0</hidden>
<items type="list">[]</items>
<required type="int">0</required>
<size type="int">1</size>
<title>Unit</title>
</values>
<tales>
<items>here/portal_categories/quantity_unit/getFormItemList</items>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="unknown_selection">You selected an item that was not in the list.</message>
</messages>
</field>
<field><id>listbox_price</id> <type>FloatField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default></default>
<description></description>
<display_maxwidth></display_maxwidth>
<display_width type="int">10</display_width>
<external_validator></external_validator>
<extra></extra>
<hidden type="int">0</hidden>
<required type="int">0</required>
<title>Prix d'achat</title>
</values>
<tales>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="not_float">You did not enter a floating point number.</message>
</messages>
</field>
</fields>
</group>
</groups>
</form>
## Script (Python) "ActivityTool_activateAssetPriceUpdate"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=
##title=
##
# Retrieve all resources and commit select
pf_resource_list = context.SimulationTool_zGetResourceList(portal_type=['Modele', 'Assortiment'])
mp_resource_list = context.SimulationTool_zGetResourceList(portal_type=['Tissu', 'Composant'])
context.portal_simulation.commitTransaction()
# Create a new active_process
active_process = context.portal_activities.newActiveProcess(title="Calcul de valorisation du stock")
# Activate updateAssetPrice for PF
commit = 100
for b in list(pf_resource_list)[0:] :
relative_url = b.relative_url
variation_text = b.variation_text
if relative_url not in (None, ''):
if variation_text not in (None, '') or b.portal_type != 'Modele':
print "##Calculate price for %s %s" % (b.relative_url, b.variation_text)
result = context.portal_simulation.activate(activity='SQLQueue', priority=3, active_process=active_process).updateAssetPrice(
relative_url, variation_text, "group/Coramy", "site/Stock_PF" )
#print repr(result)
else:
print "###Error variation for %s" % relative_url
#commit = commit -1
#if commit == 0:
# # Commit from time to time
# context.portal_simulation.commitTransaction()
# commit = 100
else:
print "###Error unknow resource '%s'" % b.relative_url
# Activate updateAssetPrice for MP
commit = 100
for b in list(mp_resource_list)[0:] :
relative_url = b.relative_url
variation_text = b.variation_text
if relative_url not in (None, ''):
if variation_text not in (None,):
print "##Calculate price for %s %s" % (b.relative_url, b.variation_text)
result = context.portal_simulation.activate(activity='SQLQueue', priority=3, active_process=active_process).updateAssetPrice(
relative_url, variation_text, "group/Coramy", "site/Stock_MP" )
#print repr(result)
else:
print "###Error variation for %s" % relative_url
#commit = commit -1
#if commit == 0:
# # Commit from time to time
# context.portal_simulation.commitTransaction()
# commit = 100
else:
print "###Error unknow resource '%s'" % b.relative_url
return printed
## Script (Python) "ERP5Site_getAssetList"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=group_by_node=0, group_by_section=0, group_by_variation=0
##title=
##
request = context.REQUEST
stock_MP = 0
stock_PF = 1
if stock_MP == 1 :
inventory_list = context.Resource_zGetStockMPInventoryList(calculate_asset=1,
node_category='site/Stock_MP', section_category='group/Coramy',
group_by_node=group_by_node, group_by_section=group_by_section,
group_by_variation=group_by_variation,
simulation_state=['delivered', 'started', 'stopped', 'invoiced','planned','getting_ready','confirmed','ready', 'ordered'])
print "%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s" % ('Nature composant', 'Code composant', 'Variante', 'Quantite', 'Prix unitaire', 'Montant total', 'Type composant', 'Fournisseur')
for b in inventory_list:
if b.inventory <> 0 :
amount_object = b.getObject()
if amount_object is not None :
unit_price = amount_object.Amount_getSupplierPrice()
else :
unit_price = 0
# AS SOON AS POSSIBLE asset_price should be given by b.asset_price an not unit_price*b.inventory
if group_by_variation:
print "%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s" % (b.resource_relative_url.split('/')[0], b.resource_relative_url.split('/')[-1], b.variation_text.replace('\n', '-'),
str(b.inventory).replace('.',','), str(unit_price).replace('.',','), str(unit_price*b.inventory).replace('.',','), b.type_title, b.source_title)
else:
print "%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s" % (b.resource_relative_url.split('/')[0], b.resource_relative_url.split('/')[-1], '',
str(b.inventory).replace('.',','), str(unit_price).replace('.',','), str(unit_price*b.inventory).replace('.',','), b.type_title, b.source_title)
if stock_PF == 1 :
inventory_list = context.Resource_zGetStockPFInventoryList(calculate_asset=1,
node_category='site/Stock_PF', section_category='group/Coramy', collection_url='collection/2004/DIM',
group_by_node=group_by_node, group_by_section=group_by_section,
group_by_variation=group_by_variation, to_date = "2003/11/30",
section_uid=context.portal_categories.group.Coramy.uid,
simulation_state=['delivered', 'started', 'stopped', 'invoiced']) # FOR FUTURE INVNETORY add ,'planned','getting_ready','confirmed','ready', 'ordered'
print "%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s" % ('Nature produit', 'Code produit', 'Variantes', 'Quantite', 'Prix unitaire', 'Montant total', 'Famille', 'Client')
for b in inventory_list:
if b.inventory <> 0 :
amount_object = b.getObject()
if amount_object is not None :
try :
pri = amount_object.Amount_getPri()
except :
pri = -99
else :
pri = 0
if group_by_variation:
print "%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s" % (b.resource_relative_url.split('/')[0], b.resource_relative_url.split('/')[-1], b.variation_text.replace('\n', '-'),
str(b.inventory).replace('.',','), str(pri).replace('.',','), str(b.inventory*pri).replace('.',','), b.famille_title, b.destination_title, b.section_title)
else:
print "%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s" % (b.resource_relative_url.split('/')[0], b.resource_relative_url.split('/')[-1], '',
str(b.inventory).replace('.',','), str(pri).replace('.',','), str(b.inventory*pri).replace('.',','), b.famille_title, b.destination_title, b.section_title)
request.RESPONSE.setHeader('Content-Type','application/text')
return printed
## Script (Python) "ERP5Site_transferOfProperty"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=to_date
##title=
##
## Warnings:
## Prints, but never reads 'printed' variable.
##
from Products.ERP5.Document import newTempMovement
from DateTime import DateTime
# Stock sourcing states
source_state_list = ('delivered', 'started', 'stopped', 'invoiced')
coef_marge_coramy = 1.35
# Default date
now_date = DateTime(DateTime().Date())
to_date = "2003/10/31"
# Get inventory list
inventory_list = context.Resource_zGetStockPFInventoryList(calculate_asset=1,
node_category='site/Stock_PF', section_category='group/Coramy',
collection_url='collection/2004/DIM',
group_by_node=0, group_by_section=1,
group_by_variation=1, to_date=to_date,
section_uid=context.portal_categories.group.Coramy.uid,
simulation_state=source_state_list)
# Commit SQL
context.portal_simulation.commitTransaction()
# build a dictionnary of quantity, variation
quantity_dict = {}
price_dict = {}
variation_dict = {}
for inventory_item in inventory_list:
movement = inventory_item.getObject()
if movement is not None:
key = (inventory_item.resource_relative_url, tuple(movement.getVariationCategoryList()))
if not (key in quantity_dict.keys()) :
quantity_dict[key] = {}
price_dict[key] = {}
quantity_dict[key][inventory_item.section_title] = inventory_item.inventory
price_dict[key][inventory_item.section_title] = movement.Amount_getPri()*coef_marge_coramy
variation_dict[key] = movement.getVariationCategoryList()
else:
pass
#LOG('WARNING',0,'None movement found')
# Find out which are the movements to create
to_create = []
for key in quantity_dict.keys() :
section_list = quantity_dict[key].keys()
if 'Coramy' in section_list :
if quantity_dict[key]['Coramy'] > 0 :
to_create.append(key)
movement_list = []
new_id = 0
# Create movements which are needed
for relative_url, variation_category_list in to_create:
# CHECK IF EXISTING ID
key = (relative_url, variation_category_list)
new_id += 1
movement = newTempMovement( context.portal_simulation , str(new_id) )
movement.edit( resource=relative_url )
movement.setVariationCategoryList( variation_category_list )
resource = movement.getResourceValue()
if resource is not None:
# Only order existing resources
stop_date = to_date
if resource.getPortalType() in ('Modele', 'Assortiment'):
source = 'site/Stock_PF/Gravelines'
source_section = 'group/Coramy'
destination_section = 'group/Coramy/BLS'
destination = 'site/Stock_PF/Gravelines'
else:
source = source_section = resource.getSource()
destination_section = 'group/Coramy'
destination = 'site/Stock_MP/Gravelines'
movement.edit(target_quantity = quantity_dict[key]['Coramy'],
price = price_dict[key]['Coramy'],
target_start_date = stop_date,
target_stop_date = stop_date,
source = source,
source_section = source_section,
destination_section = destination_section,
destination = destination,
quantity_unit = resource.getDefaultQuantityUnit())
print "Order %s %s quantity: %s" % (movement.getResource(), movement.getVariationText(), movement.getNetConvertedTargetQuantity())
movement_list.append(movement)
# Build Deliveries
root_group = context.portal_simulation.collectMovement(movement_list)
delivery_list = context.portal_simulation.buildDeliveryList(root_group)
# Update deliveries
for delivery in delivery_list :
# update the state of the created deliveries to 'confirmed'
delivery.confirm()
# update local_roles
delivery.assign_gestionaire_designe_roles(user_name = '')
return delivery_list
## Script (Python) "Inventory_inventoriateLocatedPieceTissu"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=
##title=
##
request = context.REQUEST
item_list = context.zGetLocatedPieceTissuList()
cr = '\r'
tab = '\t'
report = "Inventaire"+tab+"Resource_variante"+tab+"Liste de pices"+cr
item_dict = {}
for item in item_list :
if not item.resource in item_dict.keys() :
item_dict[item.resource] = {}
if not item.variation in item_dict[item.resource].keys() :
item_dict[item.resource][item.variation] = []
item_dict[item.resource][item.variation].append(item.id)
for resource_key in item_dict.keys() :
for variation_key in item_dict[resource_key].keys() :
movement_list = context.Resource_zGetInventoryMovementList(resource_relative_url=resource_key,variation_relative_url=variation_key)
if len(movement_list) == 0 :
report += "pas d'inventaire"+tab+variation_key+tab+str(item_dict[resource_key][variation_key])+cr
else :
movement = movement_list[0].getObject()
if movement is not None :
movement.setItemIdList(item_dict[resource_key][variation_key])
report += movement.getRelativeUrl()+tab+variation_key+tab+str(item_dict[resource_key][variation_key])+cr
else:
report += "None"+tab+variation_key+tab+str(item_dict[resource_key][variation_key])+cr
request.RESPONSE.setHeader('Content-Type','application/text')
return report
## Script (Python) "Inventory_launchTissuInventoryBuilder"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=
##title=
##
request = context.REQUEST
supplier_list = context.zGetTissuSupplierList()
cr = '\r'
tab = '\t'
report = "Cration d'inventaires en cours pour :" + cr
for supplier_item in supplier_list :
supplier = supplier_item.getObject()
if supplier is not None :
supplier.activate().Inventory_tissuInventoryBuilder(supplier_list=[supplier.getTitle(),])
report += supplier.getTitle()+cr
return report
## Script (Python) "Inventory_tissuInventoryBuilder"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=product_reference_list=[], supplier_list=[]
##title=Add Lines to an Inventory
##
inventory_line_portal_type = "Inventory MP Line"
product_list = []
if len(product_reference_list) > 0 :
product_list += product_reference_list
supplier_list = ['']
elif len(supplier_list) > 0 :
product_raw_list = context.Resource_sqlResourceSupplierSearch(supplier_title_list=supplier_list)
for product_item in product_raw_list :
product_list.append(product_item.title)
if len(product_list) > 0 :
# build the inventory
inventory_module = context.getPortalObject().inventaire_mp
for supplier in supplier_list :
# create inventory
new_inventory_id = str(inventory_module.generateNewId())
my_categories = ['destination/site/Stock_MP/Gravelines','destination_section/group/Coramy']
context.portal_types.constructContent(type_name = 'Inventory MP',
container = inventory_module,
id = new_inventory_id,
description = supplier,
start_date = DateTime(),
categories = my_categories)
inventory = inventory_module[new_inventory_id]
for line_product in product_list :
new_id = str(inventory.generateNewId())
inventory.portal_types.constructContent(type_name=inventory_line_portal_type,
container=inventory,
id=new_id)
inventory_line = inventory[new_id]
resource_list = context.portal_catalog(id=line_product, portal_type='Tissu')
if len(resource_list) > 0:
resource_value = resource_list[0].getObject()
if resource_value is not None:
if resource_value.getPortalType() == 'Tissu' :
my_variation_base_category_list = ['coloris']
else :
my_variation_base_category_list = []
inventory_line.edit(description=line_product ,
resource_value = resource_value,
variation_base_category_list = my_variation_base_category_list)
my_variation_category_list = []
for category_tuple in inventory_line.getVariationRangeCategoryItemList() :
my_variation_category_list.append(category_tuple[0])
inventory_line.setVariationCategoryList(my_variation_category_list)
else:
inventory_line.edit(description=line_product)
<?xml version="1.0" encoding="iso-8859-1"?>
<form>
<title>Pice de tissu</title>
<name>item_tissu_view</name>
<action>base_edit</action>
<enctype></enctype>
<method>POST</method>
<pt>form_view</pt>
<groups>
<group>
<title>left</title>
<fields>
<field><id>my_id</id> <type>StringField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default></default>
<description></description>
<display_maxwidth></display_maxwidth>
<display_width type="int">10</display_width>
<external_validator></external_validator>
<extra></extra>
<hidden type="int">0</hidden>
<max_length></max_length>
<required type="int">1</required>
<title>N de pice</title>
<truncate type="int">0</truncate>
</values>
<tales>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="too_long">Too much input was given.</message>
</messages>
</field>
<field><id>my_resource_id</id> <type>RelationStringField</type>
<values>
<alternate_name></alternate_name>
<base_category>resource</base_category>
<catalog_index>id</catalog_index>
<css_class></css_class>
<default></default>
<default_module>tissu</default_module>
<description></description>
<display_maxwidth></display_maxwidth>
<display_width type="int">20</display_width>
<external_validator></external_validator>
<extra></extra>
<hidden type="int">0</hidden>
<jump_method>base_jump_relation</jump_method>
<max_length></max_length>
<portal_type type="list">[('Tissu', 'Tissu')]</portal_type>
<required type="int">0</required>
<title>Tissu</title>
<truncate type="int">0</truncate>
<update_method>base_update_relation</update_method>
</values>
<tales>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="too_long">Too much input was given.</message>
</messages>
</field>
<field><id>my_variation_category_list</id> <type>ListField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default></default>
<description></description>
<external_validator></external_validator>
<extra></extra>
<first_item type="int">0</first_item>
<hidden type="int">0</hidden>
<items type="list">[]</items>
<required type="int">0</required>
<size type="int">1</size>
<title>Coloris</title>
</values>
<tales>
<default>python:here.getVariationCategoryList()[0]</default>
<items>python:[('','')]+here.getVariationRangeCategoryItemList()</items>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="unknown_selection">You selected an item that was not in the list.</message>
</messages>
</field>
<field><id>my_laize_utile</id> <type>FloatField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default></default>
<description></description>
<display_maxwidth></display_maxwidth>
<display_width type="int">20</display_width>
<external_validator></external_validator>
<extra></extra>
<hidden type="int">0</hidden>
<required type="int">0</required>
<title>Laize utile (cm)</title>
</values>
<tales>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="not_float">You did not enter a floating point number.</message>
</messages>
</field>
<field><id>my_location</id> <type>StringField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default></default>
<description></description>
<display_maxwidth></display_maxwidth>
<display_width type="int">20</display_width>
<external_validator></external_validator>
<extra></extra>
<hidden type="int">0</hidden>
<max_length></max_length>
<required type="int">0</required>
<title>Emplacement</title>
<truncate type="int">0</truncate>
</values>
<tales>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="too_long">Too much input was given.</message>
</messages>
</field>
</fields>
</group>
<group>
<title>right</title>
<fields>
<field><id>my_source_title</id> <type>RelationStringField</type>
<values>
<alternate_name></alternate_name>
<base_category>source</base_category>
<catalog_index>title</catalog_index>
<css_class></css_class>
<default></default>
<default_module>organisation</default_module>
<description></description>
<display_maxwidth></display_maxwidth>
<display_width type="int">20</display_width>
<external_validator></external_validator>
<extra></extra>
<hidden type="int">0</hidden>
<jump_method>base_jump_relation</jump_method>
<max_length></max_length>
<portal_type type="list">[('Organisation', 'Organisation'), ('Category', 'Category')]</portal_type>
<required type="int">0</required>
<title>Fournisseur</title>
<truncate type="int">0</truncate>
<update_method>base_update_relation</update_method>
</values>
<tales>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="too_long">Too much input was given.</message>
</messages>
</field>
<field><id>my_source_reference</id> <type>StringField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default></default>
<description></description>
<display_maxwidth></display_maxwidth>
<display_width type="int">20</display_width>
<external_validator></external_validator>
<extra></extra>
<hidden type="int">0</hidden>
<max_length></max_length>
<required type="int">0</required>
<title>N pice fournisseur</title>
<truncate type="int">0</truncate>
</values>
<tales>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="too_long">Too much input was given.</message>
</messages>
</field>
<field><id>my_bain_teinture</id> <type>StringField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default></default>
<description></description>
<display_maxwidth></display_maxwidth>
<display_width type="int">20</display_width>
<external_validator></external_validator>
<extra></extra>
<hidden type="int">0</hidden>
<max_length></max_length>
<required type="int">0</required>
<title>N bain teinture</title>
<truncate type="int">0</truncate>
</values>
<tales>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="too_long">Too much input was given.</message>
</messages>
</field>
<field><id>my_quantity</id> <type>FloatField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default></default>
<description></description>
<display_maxwidth></display_maxwidth>
<display_width type="int">10</display_width>
<external_validator></external_validator>
<extra></extra>
<hidden type="int">0</hidden>
<required type="int">0</required>
<title>Quantit initiale</title>
</values>
<tales>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="not_float">You did not enter a floating point number.</message>
</messages>
</field>
<field><id>my_remaining_quantity</id> <type>FloatField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default></default>
<description></description>
<display_maxwidth></display_maxwidth>
<display_width type="int">10</display_width>
<external_validator></external_validator>
<extra></extra>
<hidden type="int">0</hidden>
<required type="int">0</required>
<title>Quantit restante</title>
</values>
<tales>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="not_float">You did not enter a floating point number.</message>
</messages>
</field>
<field><id>my_quantity_unit</id> <type>ListField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default></default>
<description></description>
<external_validator></external_validator>
<extra></extra>
<first_item type="int">0</first_item>
<hidden type="int">0</hidden>
<items type="list">[]</items>
<required type="int">0</required>
<size type="int">1</size>
<title>Unit</title>
</values>
<tales>
<items>here/getQuantityUnitRangeItemList</items>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="unknown_selection">You selected an item that was not in the list.</message>
</messages>
</field>
</fields>
</group>
<group>
<title>center</title>
<fields>
</fields>
</group>
<group>
<title>bottom</title>
<fields>
<field><id>listbox</id> <type>ListBox</type>
<values>
<all_columns type="list">[]</all_columns>
<all_editable_columns type="list">[]</all_editable_columns>
<alternate_name></alternate_name>
<columns type="list">[('relative_url', 'Mouvement'), ('portal_type', 'Type'), ('start_date', 'Date exp\xe9dition'), ('source_title', 'Exp\xe9diteur'), ('stop_date', 'Date Livraison'), ('destination_title', 'Destinataire'), ('quantity', 'Quantit\xe9')]</columns>
<css_class></css_class>
<default></default>
<default_params type="list">[('id', "''")]</default_params>
<description></description>
<domain_root_list type="list">[]</domain_root_list>
<domain_tree type="int">0</domain_tree>
<editable_columns type="list">[]</editable_columns>
<external_validator></external_validator>
<global_attributes type="list">[]</global_attributes>
<hidden type="int">0</hidden>
<lines type="int">10</lines>
<list_action>list</list_action>
<list_method type="method">PieceTissu_zGetAggregateRelatedMovementList</list_method>
<meta_types type="list">[]</meta_types>
<portal_types type="list">[]</portal_types>
<report_root_list type="list">[]</report_root_list>
<report_tree type="int">0</report_tree>
<search type="int">0</search>
<search_columns type="list">[]</search_columns>
<select type="int">0</select>
<selection_name>item_related_delivery_selection</selection_name>
<sort type="list">[]</sort>
<stat_method></stat_method>
<title>Mouvements</title>
</values>
<tales>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
</messages>
</field>
</fields>
</group>
</groups>
</form>
\ No newline at end of file
## Script (Python) "PieceTissu_resetTargetQuantityOnUnaggregatedMovementList"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=delivery_uid
##title=
##
movement_list = context.PieceTissu_zGetUnaggregatedTissuMovementList(uid=delivery_uid)
for movement_item in movement_list :
movement = movement_item.getObject()
if movement is not None:
movement.Movement_resetTargetQuantity()
<dtml-comment>
title:
connection_id:MySQL
max_rows:100000
max_cache:100
cache_time:0
class_name:ZSQLBrain
class_file:zsqlbrain.py
</dtml-comment>
<params>uid</params>
SELECT DISTINCT delivery.relative_url, delivery.path, delivery.portal_type, movement.start_date, movement.quantity, movement.inventory, movement.stop_date, source_node.title as source_title, destination_node.title as destination_title
FROM catalog, catalog as piece_tissu, catalog as delivery, category, movement
LEFT JOIN catalog as source_node ON source_node.uid = movement.source_uid
LEFT JOIN catalog as destination_node ON destination_node.uid = movement.destination_uid
WHERE catalog.uid=category.uid
AND piece_tissu.uid = category.category_uid
AND piece_tissu.portal_type = "Piece Tissu"
AND category.base_category_uid = <dtml-var "portal_categories.aggregate.uid">
AND movement.uid = catalog.uid
AND delivery.uid = movement.delivery_uid
<dtml-if uid>
AND piece_tissu.uid = <dtml-sqlvar uid type="int">
</dtml-if>
ORDER BY movement.stop_date DESC, movement.start_date DESC
\ No newline at end of file
<dtml-comment>
title:
connection_id:MySQL
max_rows:100000
max_cache:100
cache_time:0
class_name:ZSQLBrain
class_file:zsqlbrain.py
</dtml-comment>
<params>uid</params>
SELECT DISTINCT catalog.relative_url, catalog.path
FROM catalog, catalog as resource, catalog as delivery, movement
LEFT JOIN category
ON (category.uid=movement.uid
AND category.base_category_uid = <dtml-var "portal_categories.aggregate.uid">)
WHERE movement.uid = catalog.uid
AND movement.target_quantity <> 0
AND category.uid IS NULL
AND movement.is_accountable = 1
AND resource.uid = movement.resource_uid
AND resource.portal_type = "Tissu"
AND delivery.uid = movement.delivery_uid
AND delivery.uid = <dtml-var uid>
\ No newline at end of file
<dtml-comment>
title:
connection_id:MySQL
max_rows:1000
max_cache:100
cache_time:0
class_name:ZSQLBrain
class_file:zsqlbrain.py
</dtml-comment>
<params>resource_relative_url
variation_relative_url</params>
SELECT inventory_cell.relative_url, inventory_cell.path, movement.start_date, movement.stop_date
FROM movement, catalog as inventory_cell, catalog as resource, catalog as variation, category as cat1, category as cat2, catalog as delivery, catalog as inventory_line
WHERE inventory_cell.portal_type = "Inventory Cell"
AND inventory_cell.uid = movement.uid
AND movement.resource_uid = resource.uid
AND resource.relative_url = "<dtml-var resource_relative_url>"
AND variation.relative_url = "<dtml-var variation_relative_url>"
AND delivery.portal_type = "Inventory MP"
AND delivery.uid = movement.delivery_uid
AND inventory_cell.parent_uid = inventory_line.uid
AND cat2.uid = inventory_cell.uid
AND cat2.base_category_uid = <dtml-var "portal_categories.coloris.uid">
AND cat2.category_uid = variation.uid
AND cat1.uid = inventory_line.uid
AND cat1.base_category_uid = <dtml-var "portal_categories.resource.uid">
AND cat1.category_uid = resource.uid
ORDER BY movement.stop_date DESC, movement.start_date DESC
\ No newline at end of file
<dtml-comment>
title:
connection_id:MySQL
max_rows:20000
max_cache:100
cache_time:0
class_name:InventoryListBrain
class_file:InventoryBrain.py
</dtml-comment>
<params>resource_uid:list
resource:list
from_date
to_date
node_uid
section_uid
node
section
variation_text="XXX_marker"
node_category
section_category
resource_category
omit_simulation
omit_input
omit_output
simulation_state
query
calculate_asset:int=0
group_by_node:int=1
group_by_section:int=1
group_by_variation:int=1</params>
SELECT
SUM(stock.quantity) AS inventory,
<dtml-if "calculate_asset != 0"> SUM(stock.total_asset_price) AS asset_price, </dtml-if>
node.title AS node_title,
node.relative_url AS node_relative_url,
section.title AS section_title,
section.relative_url AS section_relative_url,
resource.title AS resource_title,
resource.relative_url AS resource_relative_url,
resource.uid AS resource_uid,
movement.variation_text AS variation_text,
type_compo.title AS type_title,
resource.default_source_title AS source_title,
MAX(catalog.path) AS path
FROM
movement
LEFT JOIN catalog AS resource ON (movement.resource_uid = resource.uid)
LEFT JOIN category as cat_type_compo ON (cat_type_compo.uid = resource.uid
AND cat_type_compo.category_strict_membership = 1
AND ( cat_type_compo.base_category_uid = <dtml-var "portal_categories.type_composant.uid">
OR cat_type_compo.base_category_uid = <dtml-var "portal_categories.motif.uid"> ) )
LEFT JOIN catalog AS type_compo ON (type_compo.uid = cat_type_compo.category_uid)
LEFT JOIN catalog ON (catalog.uid = movement.uid)
LEFT JOIN stock ON (stock.uid = movement.uid)
LEFT JOIN catalog AS node ON (stock.node_uid = node.uid)
LEFT JOIN catalog AS section ON (stock.section_uid = section.uid)
<dtml-if node_category>, catalog AS node_c, catalog AS node_bc, category AS node_membership </dtml-if> <dtml-if section_category>, catalog AS section_c, catalog AS section_bc, category AS section_membership</dtml-if> <dtml-if resource_category>, catalog AS resource_c, catalog AS resource_bc, category AS resource_membership </dtml-if> <dtml-if query>, category </dtml-if>
WHERE
1 = 1
<dtml-if resource>AND (<dtml-in resource> resource.relative_url = <dtml-sqlvar sequence-item type="string"><dtml-if sequence-end><dtml-else> OR </dtml-if></dtml-in>)
</dtml-if><dtml-if resource_uid>AND (<dtml-in resource_uid> movement.resource_uid = <dtml-sqlvar sequence-item type="int"><dtml-if sequence-end><dtml-else> OR </dtml-if></dtml-in>)
</dtml-if>AND movement.is_accountable = 1
<dtml-if from_date>AND movement.stop_date >= <dtml-sqlvar from_date type="string">
</dtml-if><dtml-if to_date>AND movement.stop_date < <dtml-sqlvar to_date type="string">
</dtml-if><dtml-if node_uid>AND stock.node_uid = <dtml-sqlvar node_uid type="int">
</dtml-if><dtml-if section_uid>AND stock.section_uid = <dtml-sqlvar section_uid type="int">
</dtml-if><dtml-if "variation_text <> 'XXX_marker'">AND movement.variation_text = <dtml-sqlvar variation_text type="string">
</dtml-if><dtml-if node>AND node.relative_url = <dtml-sqlvar node type="string">
</dtml-if><dtml-if section>AND section.relative_url = <dtml-sqlvar section type="string">
</dtml-if><dtml-if node_category>AND node_c.relative_url = <dtml-sqlvar node_category type="string">
AND node_membership.category_uid = node_c.uid
AND node_membership.base_category_uid = node_bc.uid
AND node_membership.uid = node.uid
</dtml-if><dtml-if section_category>AND section_c.relative_url = <dtml-sqlvar section_category type="string">
AND section_membership.category_uid = section_c.uid
AND section_membership.base_category_uid = section_bc.uid
AND section_membership.uid = section.uid
</dtml-if><dtml-if resource_category>AND resource_c.relative_url = <dtml-sqlvar resource_category type="string">
AND resource_membership.category_uid = resource_c.uid
AND resource_membership.base_category_uid = resource_bc.uid
AND resource_membership.uid = resource.uid
</dtml-if><dtml-if omit_simulation>AND catalog.portal_type != "Simulation Movement"
</dtml-if><dtml-if omit_input>AND stock.quantity < 0
</dtml-if><dtml-if omit_output>AND stock.quantity > 0
</dtml-if><dtml-if simulation_state>AND (<dtml-in simulation_state> catalog.simulation_state = <dtml-sqlvar sequence-item type="string"><dtml-if sequence-end><dtml-else> OR </dtml-if></dtml-in>)
</dtml-if><dtml-if query>AND category.uid = node.uid
AND <dtml-var query></dtml-if>
AND catalog.uid is not NULL
AND resource.uid is not NULL
GROUP BY
<dtml-if group_by_node>stock.node_uid, </dtml-if><dtml-if group_by_section>stock.section_uid, </dtml-if>movement.resource_uid<dtml-if group_by_variation>, movement.variation_text</dtml-if>
ORDER BY
node.title, resource.title, movement.variation_text
\ No newline at end of file
<dtml-comment>
title:
connection_id:MySQL
max_rows:20000
max_cache:100
cache_time:0
class_name:InventoryListBrain
class_file:InventoryBrain.py
</dtml-comment>
<params>resource_uid:list
resource:list
from_date
to_date
node_uid
section_uid
node
section
variation_text="XXX_marker"
node_category
section_category
resource_category
omit_simulation
omit_input
omit_output
simulation_state
query
calculate_asset:int=0
group_by_node:int=1
group_by_section:int=1
group_by_variation:int=1
collection_url</params>
SELECT
SUM(stock.quantity) AS inventory,
<dtml-if "calculate_asset != 0"> SUM(stock.total_asset_price) AS asset_price, </dtml-if>
node.title AS node_title,
node.relative_url AS node_relative_url,
section.title AS section_title,
section.relative_url AS section_relative_url,
resource.title AS resource_title,
resource.relative_url AS resource_relative_url,
resource.uid AS resource_uid,
movement.variation_text AS variation_text,
famille.title AS famille_title,
resource.default_destination_title as destination_title,
MAX(catalog.path) AS path
FROM
movement
LEFT JOIN catalog AS resource ON (movement.resource_uid = resource.uid)
<dtml-if collection_url>
LEFT JOIN catalog AS my_collection ON (my_collection.relative_url = "<dtml-var collection_url>")
LEFT JOIN category as cat_collection ON (cat_collection.uid = resource.uid
AND cat_collection.category_uid = my_collection.uid
AND cat_collection.base_category_uid = <dtml-var "portal_categories.collection.uid"> )
</dtml-if>
LEFT JOIN category as cat_famille ON ( cat_famille.uid = resource.uid
AND cat_famille.category_strict_membership = 1
AND cat_famille.base_category_uid = <dtml-var "portal_categories.eip.uid"> )
LEFT JOIN catalog AS famille ON (famille.uid = cat_famille.category_uid)
LEFT JOIN catalog ON (catalog.uid = movement.uid)
LEFT JOIN stock ON (stock.uid = movement.uid)
LEFT JOIN catalog AS node ON (stock.node_uid = node.uid)
LEFT JOIN catalog AS section ON (stock.section_uid = section.uid)
<dtml-if node_category>, catalog AS node_c, catalog AS node_bc, category AS node_membership </dtml-if> <dtml-if section_category>, catalog AS section_c, catalog AS section_bc, category AS section_membership</dtml-if> <dtml-if resource_category>, catalog AS resource_c, catalog AS resource_bc, category AS resource_membership </dtml-if> <dtml-if query>, category </dtml-if>
WHERE
1 = 1
<dtml-if resource>AND (<dtml-in resource> resource.relative_url = <dtml-sqlvar sequence-item type="string"><dtml-if sequence-end><dtml-else> OR </dtml-if></dtml-in>)
</dtml-if><dtml-if resource_uid>AND (<dtml-in resource_uid> movement.resource_uid = <dtml-sqlvar sequence-item type="int"><dtml-if sequence-end><dtml-else> OR </dtml-if></dtml-in>)
</dtml-if>AND movement.is_accountable = 1
<dtml-if from_date>AND movement.stop_date >= <dtml-sqlvar from_date type="string">
</dtml-if><dtml-if to_date>AND movement.stop_date < <dtml-sqlvar to_date type="string">
</dtml-if><dtml-if node_uid>AND stock.node_uid = <dtml-sqlvar node_uid type="int">
</dtml-if><dtml-if section_uid>AND stock.section_uid = <dtml-sqlvar section_uid type="int">
</dtml-if><dtml-if "variation_text <> 'XXX_marker'">AND movement.variation_text = <dtml-sqlvar variation_text type="string">
</dtml-if><dtml-if node>AND node.relative_url = <dtml-sqlvar node type="string">
</dtml-if><dtml-if section>AND section.relative_url = <dtml-sqlvar section type="string">
</dtml-if><dtml-if node_category>AND node_c.relative_url = <dtml-sqlvar node_category type="string">
AND node_membership.category_uid = node_c.uid
AND node_membership.base_category_uid = node_bc.uid
AND node_membership.uid = node.uid
</dtml-if><dtml-if section_category>AND section_c.relative_url = <dtml-sqlvar section_category type="string">
AND section_membership.category_uid = section_c.uid
AND section_membership.base_category_uid = section_bc.uid
AND section_membership.uid = section.uid
</dtml-if><dtml-if resource_category>AND resource_c.relative_url = <dtml-sqlvar resource_category type="string">
AND resource_membership.category_uid = resource_c.uid
AND resource_membership.base_category_uid = resource_bc.uid
AND resource_membership.uid = resource.uid
</dtml-if><dtml-if omit_simulation>AND catalog.portal_type != "Simulation Movement"
</dtml-if><dtml-if omit_input>AND stock.quantity < 0
</dtml-if><dtml-if omit_output>AND stock.quantity > 0
</dtml-if><dtml-if simulation_state>AND (<dtml-in simulation_state> catalog.simulation_state = <dtml-sqlvar sequence-item type="string"><dtml-if sequence-end><dtml-else> OR </dtml-if></dtml-in>)
</dtml-if><dtml-if query>AND category.uid = node.uid
AND <dtml-var query></dtml-if>
<dtml-if collection_url>
AND cat_collection.uid is not NULL
</dtml-if>
AND catalog.uid is not NULL
GROUP BY
<dtml-if group_by_node>stock.node_uid, </dtml-if><dtml-if group_by_section>stock.section_uid, </dtml-if>movement.resource_uid<dtml-if group_by_variation>, movement.variation_text</dtml-if>
ORDER BY
node.title, resource.title, movement.variation_text
\ No newline at end of file
## Script (Python) "SimulationTool_activateRequirementList"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=
##title=
##
if 1:
# Erase existing auto_planned
order_list = context.portal_catalog(simulation_state="auto_planned", parent_uid=[context.ordre_fabrication.getUid()])
order_id_list = map(lambda x:x.id,order_list)
object_id_list = context.ordre_fabrication.objectIds()
order_id_list = filter(lambda x: x in object_id_list, order_id_list)
context.ordre_fabrication.deleteContent(order_id_list)
order_list = context.portal_catalog(simulation_state="auto_planned", parent_uid=[context.commande_achat.getUid()])
order_id_list = map(lambda x:x.id,order_list)
object_id_list = context.commande_achat.objectIds()
order_id_list = filter(lambda x: x in object_id_list, order_id_list)
context.commande_achat.deleteContent(order_id_list)
#return "Done"
def activateNodeSection(node_category, section_category):
# Stock sourcing states
source_state_list = ('auto_planned', 'planned', 'ordered', 'confirmed', 'getting_ready', 'ready', 'started', 'stopped', 'delivered', 'invoiced')
#source_state_list = None
result = ''
# Get inventory list
#inventory_list = context.SimulationTool_getGroupFutureInventoryList(simulation_state=source_state_list)
inventory_list = context.Resource_zGetInventoryList(simulation_state=source_state_list,
node_category="site/Stock_MP",
section_category="group/Coramy",
group_by_variation=1)
# Commit SQL
# context.portal_simulation.commitTransaction()
# Call PortalSimulation_buildRequirementOrder for each missing resource
for inventory_item in inventory_list:
if inventory_item.inventory < 0 and inventory_item.inventory is not None:
# We should use a queue here rather than a dict - OVERKILL
movement = inventory_item.getObject()
if movement is not None:
resource = movement.getResourceValue()
if resource is not None:
if resource.getPortalType() != "Assortiment":
# Only source negative stock
result = result + "Activate Build Order for %s for missing quantity %s" % (inventory_item.resource_relative_url, inventory_item.inventory)
resource.activate(priority=5).SimulationTool_buildRequirementOrder(resource=inventory_item.resource_relative_url,
node_category=node_category, section_category=section_category )
return result
print activateNodeSection("site/Stock_MP", "group/Coramy")
print activateNodeSection("site/Stock_PF", "group/Coramy")
return printed
## Script (Python) "SimulationTool_buildRequirementOrder"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=resource=None,node_category=None,section_category=None
##title=
##
from Products.ERP5.Document import newTempMovement
from DateTime import DateTime
# Stock sourcing states
source_state_list = ('auto_planned', 'planned', 'ordered', 'confirmed', 'getting_ready', 'ready', 'delivered', 'started', 'stopped', 'invoiced')
#source_state_list = None
# Default date
now_date = DateTime(DateTime().Date())
# Get inventory list
#inventory_list = context.SimulationTool_getGroupFutureInventoryList(resource=resource, simulation_state=source_state_list)
inventory_list = context.Resource_zGetInventoryList(resource=[resource],
simulation_state=source_state_list,
node_category=node_category,
section_category=section_category,
group_by_variation=1)
# Commit SQL
context.portal_simulation.commitTransaction()
# First, find out which resources are missing
# and build a dictionnary of quantity, variation
quantity_dict = {}
variation_dict = {}
for inventory_item in inventory_list:
if inventory_item.inventory < 0 and inventory_item.inventory is not None:
# Only source negative stock
movement = inventory_item.getObject()
if movement is not None:
key = (inventory_item.resource_relative_url, tuple(movement.getVariationCategoryList()))
quantity_dict[key] = - inventory_item.inventory
variation_dict[key] = movement.getVariationCategoryList()
else:
pass
#LOG('ZeroStockRule WARNING',0,'None movement found')
# Commit SQL
context.portal_simulation.commitTransaction()
# A list of resources to create
to_create = quantity_dict.keys()
variated_movement_list = []
movement_list = []
new_id = 0
# Create movements which are needed
for relative_url, variation_category_list in to_create:
# CHECK IF EXISTING ID
key = (relative_url, variation_category_list)
new_id += 1
movement = newTempMovement( context.portal_simulation , str(new_id) )
movement.edit( resource=relative_url )
movement.setVariationCategoryList( variation_category_list )
resource = movement.getResourceValue()
if resource is not None:
# Only order existing resources
stop_date = resource.getNextNegativeInventoryDate(variation_text = movement.getVariationText())
if stop_date is None: # This happens if we have a negative stock already
stop_date = now_date
if resource.getPortalType() in ('Modele',):
source = 'site/Piquage'
source_section = 'group/Coramy'
destination_section = 'group/Coramy'
destination = 'site/Stock_PF/Gravelines'
else:
source = source_section = resource.getSource()
destination_section = 'group/Coramy'
destination = 'site/Stock_MP/Gravelines'
movement.edit(target_quantity = quantity_dict[key],
target_start_date = stop_date,
target_stop_date = stop_date,
source = source,
source_section = source_section,
destination_section = destination_section,
destination = destination,
quantity_unit = resource.getDefaultQuantityUnit())
print "Order %s %s quantity: %s" % (movement.getResource(), movement.getVariationText(), movement.getNetConvertedTargetQuantity())
if movement.getVariationText() == "":
movement_list.append(movement)
else:
variated_movement_list.append(movement)
# Build Order for non variated items
root_group = context.portal_simulation.collectMovement(movement_list)
order_list = context.portal_simulation.buildOrderList(root_group)
# Build Order for variated items
root_group = context.portal_simulation.collectMovement(variated_movement_list)
variated_order_list = context.portal_simulation.buildOrderList(root_group)
# Update orders
for order in order_list + variated_order_list:
print "Confirm Order %s" % order.getRelativeUrl()
order.autoPlan()
order.purchase_order_apply_condition()
# Set local_roles
# what's the gestionaire of this order
user_name = ''
# are we on a sales order or puchase order ?
if order.getPortalType() == 'Sales Order' :
user_name = order.getSourceAdministrationTitle().replace(' ','_')
elif order.getPortalType() == 'Purchase Order' :
# This is an error probably XXX
user_name = order.getDestinationAdministrationPersonTitle()
if user_name is not None:
user_name = user_name.replace(' ','_')
if user_name in (None,'',' ','_') :
user_name = "AnimatriceAppros"
# update local_roles
order.assign_gestionaire_designe_roles(user_name = user_name)
return printed
## Script (Python) "SimulationTool_updateInventory"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=
##title=
##
for b in context.SimulationTool_zGetSortedInventoryList():
print "#### Indexing Inventory %s ####" % b.relative_url
o = b.getObject()
if o is not None: o.activate(priority=4).recursiveImmediateReindexObject()
return printed
<dtml-comment>
title:
connection_id:MySQL
max_rows:100000
max_cache:0
cache_time:0
class_name:
class_file:
</dtml-comment>
<params>portal_type:list</params>
SELECT DISTINCT
catalog.relative_url AS relative_url,
catalog.portal_type AS portal_type,
movement.variation_text AS variation_text
FROM
movement, catalog
WHERE
catalog.uid = movement.resource_uid
AND movement.is_accountable = 1
<dtml-if portal_type>AND (<dtml-in portal_type> catalog.portal_type = <dtml-sqlvar sequence-item type="string"><dtml-if sequence-end><dtml-else> OR </dtml-if></dtml-in>
) </dtml-if>
\ No newline at end of file
<?xml version="1.0" encoding="iso-8859-1"?>
<form>
<title>Rechercher</title>
<name>Forme_categorySearchForm</name>
<action>Base_searchHandler</action>
<enctype></enctype>
<method>POST</method>
<pt>form_view_dialog</pt>
<groups>
<group>
<title>left</title>
<fields>
<field><id>my_id_list</id> <type>LinesField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default type="list">[]</default>
<description></description>
<external_validator></external_validator>
<extra></extra>
<height type="int">5</height>
<hidden type="int">0</hidden>
<max_length></max_length>
<max_linelength></max_linelength>
<max_lines></max_lines>
<required type="int">0</required>
<title>Forme</title>
<width type="int">40</width>
</values>
<tales>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="too_many_lines">You entered too many lines.</message>
<message name="line_too_long">A line was too long.</message>
<message name="too_long">You entered too many characters.</message>
</messages>
</field>
<field><id>my_referentiel_forme_list</id> <type>MultiListField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default type="list">[]</default>
<description></description>
<external_validator></external_validator>
<extra></extra>
<hidden type="int">0</hidden>
<items type="list">[]</items>
<required type="int">0</required>
<size type="int">5</size>
<title>Catgorie forme</title>
</values>
<tales>
<default>here/getReferentielFormeList</default>
<items>here/portal_categories/referentiel_forme/getFormItemList</items>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="unknown_selection">You selected an item that was not in the list.</message>
</messages>
</field>
<field><id>my_description</id> <type>TextAreaField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default></default>
<description></description>
<external_validator></external_validator>
<extra></extra>
<height type="int">3</height>
<hidden type="int">0</hidden>
<max_length></max_length>
<max_linelength></max_linelength>
<max_lines></max_lines>
<required type="int">0</required>
<title>Description</title>
<width type="int">40</width>
</values>
<tales>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="too_many_lines">You entered too many lines.</message>
<message name="line_too_long">A line was too long.</message>
<message name="too_long">You entered too many characters.</message>
</messages>
</field>
<field><id>my_forme_id_list</id> <type>LinesField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default type="list">[]</default>
<description></description>
<external_validator></external_validator>
<extra></extra>
<height type="int">5</height>
<hidden type="int">0</hidden>
<max_length></max_length>
<max_linelength></max_linelength>
<max_lines></max_lines>
<required type="int">0</required>
<title>Forme de base</title>
<width type="int">40</width>
</values>
<tales>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="too_many_lines">You entered too many lines.</message>
<message name="line_too_long">A line was too long.</message>
<message name="too_long">You entered too many characters.</message>
</messages>
</field>
<field><id>my_reset</id> <type>CheckBoxField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default type="int">1</default>
<description></description>
<external_validator></external_validator>
<extra></extra>
<hidden type="int">0</hidden>
<title>Recherche globale</title>
</values>
<tales>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
</messages>
</field>
<field><id>my_list_form_id</id> <type>StringField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default></default>
<description></description>
<display_maxwidth></display_maxwidth>
<display_width type="int">20</display_width>
<external_validator></external_validator>
<extra></extra>
<hidden type="int">1</hidden>
<max_length></max_length>
<required type="int">0</required>
<title></title>
<truncate type="int">0</truncate>
</values>
<tales>
<default>python:here.REQUEST.form_id</default>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="too_long">Too much input was given.</message>
</messages>
</field>
<field><id>my_list_method_id</id> <type>StringField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default>Forme_categorySearchSql</default>
<description></description>
<display_maxwidth></display_maxwidth>
<display_width type="int">20</display_width>
<external_validator></external_validator>
<extra></extra>
<hidden type="int">1</hidden>
<max_length></max_length>
<required type="int">0</required>
<title>x</title>
<truncate type="int">0</truncate>
</values>
<tales>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="too_long">Too much input was given.</message>
</messages>
</field>
</fields>
</group>
<group>
<title>right</title>
<fields>
<field><id>my_collection_list</id> <type>MultiListField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default type="list">[]</default>
<description></description>
<external_validator></external_validator>
<extra></extra>
<hidden type="int">0</hidden>
<items type="list">[]</items>
<required type="int">0</required>
<size type="int">5</size>
<title>Collection</title>
</values>
<tales>
<default>here/getCollectionList</default>
<items>here/portal_categories/collection/getFormItemList</items>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="unknown_selection">You selected an item that was not in the list.</message>
</messages>
</field>
<field><id>my_eip_list</id> <type>MultiListField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default type="list">[]</default>
<description></description>
<external_validator></external_validator>
<extra></extra>
<hidden type="int">0</hidden>
<items type="list">[]</items>
<required type="int">0</required>
<size type="int">5</size>
<title>Espace Imaginaire</title>
</values>
<tales>
<default>here/getEipList</default>
<items>here/portal_categories/eip/getFormItemList</items>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="unknown_selection">You selected an item that was not in the list.</message>
</messages>
</field>
<field><id>my_option_forme_list</id> <type>MultiListField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default type="list">[]</default>
<description></description>
<external_validator></external_validator>
<extra></extra>
<hidden type="int">0</hidden>
<items type="list">[]</items>
<required type="int">0</required>
<size type="int">5</size>
<title>Option</title>
</values>
<tales>
<items>here/portal_categories/option_forme/getFormItemList</items>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="unknown_selection">You selected an item that was not in the list.</message>
</messages>
</field>
<field><id>my_etat</id> <type>StringField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default></default>
<description></description>
<display_maxwidth></display_maxwidth>
<display_width type="int">20</display_width>
<external_validator></external_validator>
<extra></extra>
<hidden type="int">0</hidden>
<max_length></max_length>
<required type="int">0</required>
<title>Etat</title>
<truncate type="int">0</truncate>
</values>
<tales>
<default>python:here.portal_workflow.getInfoFor(here, 'forme_state')</default>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="too_long">Too much input was given.</message>
</messages>
</field>
</fields>
</group>
</groups>
</form>
\ No newline at end of file
<dtml-comment>
title:
connection_id:MySQL
max_rows:1000
max_cache:100
cache_time:0
class_name:ZSQLBrain
class_file:zsqlbrain.py
</dtml-comment>
<params>collection_list=""
description=""
eip_list=""
etat=""
forme_id_list=""
id_list=""
option_forme_list=""
present_au_catalogue=""
referentiel_forme_list=""</params>
SELECT DISTINCT forme.id, forme.relative_url, forme.path, forme.Description, forme.forme_state
FROM catalog AS forme
<dtml-if expr="_.len(collection_list)>0">
<dtml-if expr="not (_.len(collection_list)==1 and collection_list[0]=='')">
, category AS cat1
</dtml-if>
</dtml-if>
<dtml-if expr="_.len(eip_list)>0">
<dtml-if expr="not (_.len(eip_list)==1 and eip_list[0]=='')">
, category AS cat2
</dtml-if>
</dtml-if>
<dtml-if expr="_.len(option_forme_list)>0">
<dtml-if expr="not (_.len(option_forme_list)==1 and option_forme_list[0]=='')">
, category AS cat3
</dtml-if>
</dtml-if>
<dtml-if expr="_.len(referentiel_forme_list)>0">
<dtml-if expr="not (_.len(referentiel_forme_list)==1 and referentiel_forme_list[0]=='')">
, category AS cat4
</dtml-if>
</dtml-if>
<dtml-if expr="_.len(forme_id_list)>0">
<dtml-if expr="not (_.len(forme_id_list)==1 and forme_id_list[0]=='')">
, category AS cat5
JOIN catalog ON catalog.uid=cat5.category_uid
</dtml-if>
</dtml-if>
WHERE forme.portal_type = "Forme"
<dtml-if expr="_.len(id_list)>0">
AND ( forme.id LIKE "<dtml-var expr="id_list[0]">"
<dtml-in prefix="loop" expr="_.range(_.len(id_list)-1)">
OR forme.id LIKE "<dtml-var expr="id_list[loop_item+1]">"
</dtml-in>
)
</dtml-if>
<dtml-if expr="_.len(collection_list)>0">
<dtml-if expr="not (_.len(collection_list)==1 and collection_list[0]=='')">
AND cat1.uid=forme.uid
AND ( cat1.category_uid=<dtml-var expr="identify_category(base_category='collection',category=collection_list[0])">
<dtml-in prefix="loop" expr="_.range(_.len(collection_list)-1)">
OR cat1.category_uid=<dtml-var expr="identify_category(base_category='collection',category=collection_list[loop_item+1])">
</dtml-in>
)
AND cat1.base_category_uid=<dtml-var "portal_categories.collection.uid">
</dtml-if>
</dtml-if>
<dtml-if expr="_.len(eip_list)>0">
<dtml-if expr="not (_.len(eip_list)==1 and eip_list[0]=='')">
AND cat2.uid=forme.uid
AND ( cat2.category_uid=<dtml-var expr="identify_category(base_category='eip',category=eip_list[0])">
<dtml-in prefix="loop" expr="_.range(_.len(eip_list)-1)">
OR cat2.category_uid=<dtml-var expr="identify_category(base_category='eip',category=eip_list[loop_item+1])">
</dtml-in>
)
AND cat2.base_category_uid=<dtml-var "portal_categories.eip.uid">
</dtml-if>
</dtml-if>
<dtml-if expr="_.len(option_forme_list)>0">
<dtml-if expr="not (_.len(option_forme_list)==1 and option_forme_list[0]=='')">
AND cat3.uid=forme.uid
AND ( cat3.category_uid=<dtml-var expr="identify_category(base_category='option_forme',category=option_forme_list[0])">
<dtml-in prefix="loop" expr="_.range(_.len(option_forme_list)-1)">
OR cat3.category_uid=<dtml-var expr="identify_category(base_category='option_forme',category=option_forme_list[loop_item+1])">
</dtml-in>
)
AND cat3.base_category_uid=<dtml-var "portal_categories.option_forme.uid">
</dtml-if>
</dtml-if>
<dtml-if expr="_.len(referentiel_forme_list)>0">
<dtml-if expr="not (_.len(referentiel_forme_list)==1 and referentiel_forme_list[0]=='')">
AND cat4.uid=forme.uid
AND ( cat4.category_uid=<dtml-var expr="identify_category(base_category='referentiel_forme',category=referentiel_forme_list[0])">
<dtml-in prefix="loop" expr="_.range(_.len(referentiel_forme_list)-1)">
OR cat4.category_uid=<dtml-var expr="identify_category(base_category='referentiel_forme',category=referentiel_forme_list[loop_item+1])">
</dtml-in>
)
AND cat4.base_category_uid=<dtml-var "portal_categories.referentiel_forme.uid">
</dtml-if>
</dtml-if>
<dtml-if expr="_.len(forme_id_list)>0">
<dtml-if expr="not (_.len(forme_id_list)==1 and forme_id_list[0]=='')">
AND cat5.uid=forme.uid
AND cat5.base_category_uid=<dtml-var "portal_categories.specialise.uid">
AND ( (catalog.id LIKE "<dtml-var expr="forme_id_list[0]">")
<dtml-in prefix="loop" expr="_.range(_.len(forme_id_list)-1)">
OR (catalog.id LIKE "<dtml-var expr="forme_id_list[loop_item+1]">")
</dtml-in>
)
</dtml-if>
</dtml-if>
<dtml-if expr="not(etat=='')">
AND forme.forme_state LIKE "<dtml-var expr="etat">"
</dtml-if>
<dtml-if expr="not(description=='')">
AND forme.Description LIKE "<dtml-var expr="description">"
</dtml-if>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Formes</title>
<link rel=stylesheet type="text/css" href="http://erp5.coramy.fr/coramy/thumbnail.css" />
</head>
<body tal:define="forme_list python:here.object_action_list(selection_name='gamme_list')">
<h1>Dessins techniques des formes slectionnes</h1>
<div class="container">
<tal:block tal:repeat="forme python:forme_list">
<div class="float" tal:define="dessin_list python:forme.contentValues(filter={'portal_type':'Dessin Technique'})">
<a href="/" tal:attributes="href python:forme.absolute_url()">
<tal:block tal:condition="python: len(dessin_list)>0">
<img class="image" src="logo.gif" alt="Dessin technique" tal:attributes="src python:dessin_list[0].absolute_url() + '?display=small&format=jpeg&resolution=150'" />
</tal:block>
<tal:block tal:condition="python: len(dessin_list)==0">
<p>Pas de dessin associ</p>
</tal:block>
<p tal:content="python:forme.getId()" />
</a>
</div>
</tal:block>
<hr />
</div>
</body>
</html>
<?xml version="1.0" encoding="iso-8859-1"?>
<form>
<title>Rechercher</title>
<name>Tissu_categorySearchForm</name>
<action>Base_searchHandler</action>
<enctype></enctype>
<method>POST</method>
<pt>form_view_dialog</pt>
<groups>
<group>
<title>left</title>
<fields>
<field><id>my_id_list</id> <type>LinesField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default type="list">[]</default>
<description></description>
<external_validator></external_validator>
<extra></extra>
<height type="int">3</height>
<hidden type="int">0</hidden>
<max_length></max_length>
<max_linelength></max_linelength>
<max_lines></max_lines>
<required type="int">0</required>
<title>Tissu</title>
<width type="int">40</width>
</values>
<tales>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="too_many_lines">You entered too many lines.</message>
<message name="line_too_long">A line was too long.</message>
<message name="too_long">You entered too many characters.</message>
</messages>
</field>
<field><id>my_source_title</id> <type>LinesField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default type="list">[]</default>
<description></description>
<external_validator></external_validator>
<extra></extra>
<height type="int">3</height>
<hidden type="int">0</hidden>
<max_length></max_length>
<max_linelength></max_linelength>
<max_lines></max_lines>
<required type="int">0</required>
<title>Fournisseur</title>
<width type="int">40</width>
</values>
<tales>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="too_many_lines">You entered too many lines.</message>
<message name="line_too_long">A line was too long.</message>
<message name="too_long">You entered too many characters.</message>
</messages>
</field>
<field><id>my_categorie_tissu</id> <type>MultiListField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default type="list">[]</default>
<description></description>
<external_validator></external_validator>
<extra></extra>
<hidden type="int">0</hidden>
<items type="list">[]</items>
<required type="int">0</required>
<size type="int">5</size>
<title>Type tissu</title>
</values>
<tales>
<items>here/portal_categories/categorie_tissu/getFormItemList</items>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="unknown_selection">You selected an item that was not in the list.</message>
</messages>
</field>
<field><id>my_motif</id> <type>MultiListField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default type="list">[]</default>
<description></description>
<external_validator></external_validator>
<extra></extra>
<hidden type="int">0</hidden>
<items type="list">[]</items>
<required type="int">0</required>
<size type="int">5</size>
<title>Motif</title>
</values>
<tales>
<items>here/portal_categories/motif/getFormItemList</items>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="unknown_selection">You selected an item that was not in the list.</message>
</messages>
</field>
<field><id>my_description</id> <type>TextAreaField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default></default>
<description></description>
<external_validator></external_validator>
<extra></extra>
<height type="int">3</height>
<hidden type="int">0</hidden>
<max_length></max_length>
<max_linelength></max_linelength>
<max_lines></max_lines>
<required type="int">0</required>
<title>Description</title>
<width type="int">40</width>
</values>
<tales>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="too_many_lines">You entered too many lines.</message>
<message name="line_too_long">A line was too long.</message>
<message name="too_long">You entered too many characters.</message>
</messages>
</field>
<field><id>my_reset</id> <type>CheckBoxField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default type="int">1</default>
<description></description>
<external_validator></external_validator>
<extra></extra>
<hidden type="int">0</hidden>
<title>Recherche globale</title>
</values>
<tales>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
</messages>
</field>
</fields>
</group>
<group>
<title>right</title>
<fields>
<field><id>my_collection_list</id> <type>MultiListField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default type="list">[]</default>
<description></description>
<external_validator></external_validator>
<extra></extra>
<hidden type="int">0</hidden>
<items type="list">[]</items>
<required type="int">0</required>
<size type="int">5</size>
<title>Collection</title>
</values>
<tales>
<default>here/getCollectionList</default>
<items>here/portal_categories/collection/getFormItemList</items>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="unknown_selection">You selected an item that was not in the list.</message>
</messages>
</field>
<field><id>my_composition_list</id> <type>MultiListField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default type="list">[]</default>
<description></description>
<external_validator></external_validator>
<extra></extra>
<hidden type="int">0</hidden>
<items type="list">[]</items>
<required type="int">0</required>
<size type="int">5</size>
<title>Composition</title>
</values>
<tales>
<default>here/getCompositionList</default>
<items>here/portal_categories/composition/getFormItemList</items>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="unknown_selection">You selected an item that was not in the list.</message>
</messages>
</field>
<field><id>my_eip_list</id> <type>MultiListField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default type="list">[]</default>
<description></description>
<external_validator></external_validator>
<extra></extra>
<hidden type="int">0</hidden>
<items type="list">[]</items>
<required type="int">0</required>
<size type="int">5</size>
<title>Famille</title>
</values>
<tales>
<default>here/getEipList</default>
<items>here/portal_categories/eip/getFormItemList</items>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="unknown_selection">You selected an item that was not in the list.</message>
</messages>
</field>
<field><id>my_code_entretien_list</id> <type>MultiListField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default type="list">[]</default>
<description></description>
<external_validator></external_validator>
<extra></extra>
<hidden type="int">0</hidden>
<items type="list">[]</items>
<required type="int">0</required>
<size type="int">3</size>
<title>Entretien</title>
</values>
<tales>
<items>here/portal_categories/code_entretien/getFormItemList</items>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="unknown_selection">You selected an item that was not in the list.</message>
</messages>
</field>
<field><id>my_composant_state</id> <type>StringField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default></default>
<description></description>
<display_maxwidth></display_maxwidth>
<display_width type="int">40</display_width>
<external_validator></external_validator>
<extra></extra>
<hidden type="int">0</hidden>
<max_length></max_length>
<required type="int">0</required>
<title>Etat</title>
<truncate type="int">0</truncate>
</values>
<tales>
<default>python:here.portal_workflow.getInfoFor(here, 'composant_state')</default>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="too_long">Too much input was given.</message>
</messages>
</field>
<field><id>my_list_form_id</id> <type>StringField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default></default>
<description></description>
<display_maxwidth></display_maxwidth>
<display_width type="int">20</display_width>
<external_validator></external_validator>
<extra></extra>
<hidden type="int">1</hidden>
<max_length></max_length>
<required type="int">0</required>
<title></title>
<truncate type="int">0</truncate>
</values>
<tales>
<default>python:here.REQUEST.form_id</default>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="too_long">Too much input was given.</message>
</messages>
</field>
<field><id>my_list_method_id</id> <type>StringField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default>Tissu_categorySearchSql</default>
<description></description>
<display_maxwidth></display_maxwidth>
<display_width type="int">20</display_width>
<external_validator></external_validator>
<extra></extra>
<hidden type="int">1</hidden>
<max_length></max_length>
<required type="int">0</required>
<title>x</title>
<truncate type="int">0</truncate>
</values>
<tales>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="too_long">Too much input was given.</message>
</messages>
</field>
</fields>
</group>
</groups>
</form>
\ No newline at end of file
<dtml-comment>
title:
connection_id:MySQL
max_rows:1000
max_cache:100
cache_time:0
class_name:ZSQLBrain
class_file:zsqlbrain.py
</dtml-comment>
<params>id_list=""
source_title=""
categorie_tissu=""
motif=""
description=""
collection_list=""
composition_list=""
eip_list=""
code_entretien_list=""
composant_state=""</params>
SELECT DISTINCT tissu.id, tissu.relative_url, tissu.path, tissu.Description, tissu.composant_state
FROM catalog AS tissu
<dtml-if expr="_.len(categorie_tissu)>0">
<dtml-if expr="not (_.len(categorie_tissu)==1 and categorie_tissu[0]=='')">
, category AS cat1
</dtml-if>
</dtml-if>
<dtml-if expr="_.len(motif)>0">
<dtml-if expr="not (_.len(motif)==1 and motif[0]=='')">
, category AS cat2
</dtml-if>
</dtml-if>
<dtml-if expr="_.len(collection_list)>0">
<dtml-if expr="not (_.len(collection_list)==1 and collection_list[0]=='')">
, category AS cat3
</dtml-if>
</dtml-if>
<dtml-if expr="_.len(composition_list)>0">
<dtml-if expr="not (_.len(composition_list)==1 and composition_list[0]=='')">
, category AS cat4
</dtml-if>
</dtml-if>
<dtml-if expr="_.len(eip_list)>0">
<dtml-if expr="not (_.len(eip_list)==1 and eip_list[0]=='')">
, category AS cat5
</dtml-if>
</dtml-if>
<dtml-if expr="_.len(code_entretien_list)>0">
<dtml-if expr="not (_.len(code_entretien_list)==1 and code_entretien_list[0]=='')">
, category AS cat6
</dtml-if>
</dtml-if>
<dtml-if expr="_.len(source_title)>0">
<dtml-if expr="not (_.len(source_title)==1 and source_title[0]=='')">
, category AS cat7
JOIN catalog ON catalog.uid=cat7.category_uid
</dtml-if>
</dtml-if>
WHERE tissu.portal_type = "Tissu"
<dtml-if expr="_.len(id_list)>0">
AND ( tissu.id LIKE "<dtml-var expr="id_list[0]">"
<dtml-in prefix="loop" expr="_.range(_.len(id_list)-1)">
OR tissu.id LIKE "<dtml-var expr="id_list[loop_item+1]">"
</dtml-in>
)
</dtml-if>
<dtml-if expr="_.len(source_title)>0">
<dtml-if expr="not (_.len(source_title)==1 and source_title[0]=='')">
AND cat7.uid=tissu.uid
AND cat7.base_category_uid=<dtml-var "portal_categories.source.uid">
AND ( (catalog.title LIKE "<dtml-var expr="source_title[0]">")
<dtml-in prefix="loop" expr="_.range(_.len(source_title)-1)">
OR (catalog.title LIKE "<dtml-var expr="source_title[loop_item+1]">")
</dtml-in>
)
</dtml-if>
</dtml-if>
<dtml-if expr="_.len(categorie_tissu)>0">
<dtml-if expr="not (_.len(categorie_tissu)==1 and categorie_tissu[0]=='')">
AND cat1.uid=tissu.uid
AND ( cat1.category_uid=<dtml-var expr="identify_category(base_category='categorie_tissu',category=categorie_tissu[0])">
<dtml-in prefix="loop" expr="_.range(_.len(categorie_tissu)-1)">
OR cat1.category_uid=<dtml-var expr="identify_category(base_category='categorie_tissu',category=categorie_tissu[loop_item+1])">
</dtml-in>
)
AND cat1.base_category_uid=<dtml-var "portal_categories.categorie_tissu.uid">
</dtml-if>
</dtml-if>
<dtml-if expr="_.len(motif)>0">
<dtml-if expr="not (_.len(motif)==1 and motif[0]=='')">
AND cat2.uid=tissu.uid
AND ( cat2.category_uid=<dtml-var expr="identify_category(base_category='motif',category=motif[0])">
<dtml-in prefix="loop" expr="_.range(_.len(motif)-1)">
OR cat2.category_uid=<dtml-var expr="identify_category(base_category='motif',category=motif[loop_item+1])">
</dtml-in>
)
AND cat2.base_category_uid=<dtml-var "portal_categories.motif.uid">
</dtml-if>
</dtml-if>
<dtml-if expr="_.len(collection_list)>0">
<dtml-if expr="not (_.len(collection_list)==1 and collection_list[0]=='')">
AND cat3.uid=tissu.uid
AND ( cat3.category_uid=<dtml-var expr="identify_category(base_category='collection',category=collection_list[0])">
<dtml-in prefix="loop" expr="_.range(_.len(collection_list)-1)">
OR cat3.category_uid=<dtml-var expr="identify_category(base_category='collection',category=collection_list[loop_item+1])">
</dtml-in>
)
AND cat3.base_category_uid=<dtml-var "portal_categories.collection.uid">
</dtml-if>
</dtml-if>
<dtml-if expr="_.len(composition_list)>0">
<dtml-if expr="not (_.len(composition_list)==1 and composition_list[0]=='')">
AND cat4.uid=tissu.uid
AND ( cat4.category_uid=<dtml-var expr="identify_category(base_category='composition',category=composition_list[0])">
<dtml-in prefix="loop" expr="_.range(_.len(composition_list)-1)">
OR cat4.category_uid=<dtml-var expr="identify_category(base_category='composition',category=composition_list[loop_item+1])">
</dtml-in>
)
AND cat4.base_category_uid=<dtml-var "portal_categories.composition.uid">
</dtml-if>
</dtml-if>
<dtml-if expr="_.len(eip_list)>0">
<dtml-if expr="not (_.len(eip_list)==1 and eip_list[0]=='')">
AND cat5.uid=tissu.uid
AND ( cat5.category_uid=<dtml-var expr="identify_category(base_category='eip',category=eip_list[0])">
<dtml-in prefix="loop" expr="_.range(_.len(eip_list)-1)">
OR cat5.category_uid=<dtml-var expr="identify_category(base_category='eip',category=eip_list[loop_item+1])">
</dtml-in>
)
AND cat5.base_category_uid=<dtml-var "portal_categories.eip.uid">
</dtml-if>
</dtml-if>
<dtml-if expr="_.len(code_entretien_list)>0">
<dtml-if expr="not (_.len(code_entretien_list)==1 and code_entretien_list[0]=='')">
AND cat6.uid=tissu.uid
AND ( cat6.category_uid=<dtml-var expr="identify_category(base_category='code_entretien',category=code_entretien_list[0])">
<dtml-in prefix="loop" expr="_.range(_.len(code_entretien_list)-1)">
OR cat6.category_uid=<dtml-var expr="identify_category(base_category='code_entretien',category=code_entretien_list[loop_item+1])">
</dtml-in>
)
AND cat6.base_category_uid=<dtml-var "portal_categories.code_entretien.uid">
</dtml-if>
</dtml-if>
<dtml-if expr="not(composant_state=='')">
AND tissu.composant_state LIKE "<dtml-var expr="composant_state">"
</dtml-if>
<dtml-if expr="not(description=='')">
AND tissu.Description LIKE "<dtml-var expr="description">"
</dtml-if>
<?xml version="1.0" encoding="iso-8859-1"?>
<form>
<title>Rechercher</title>
<name>Forme_categorySearchForm</name>
<action>Base_searchHandler</action>
<enctype></enctype>
<method>POST</method>
<pt>form_view_dialog</pt>
<groups>
<group>
<title>left</title>
<fields>
<field><id>my_id_list</id> <type>LinesField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default type="list">[]</default>
<description></description>
<external_validator></external_validator>
<extra></extra>
<height type="int">5</height>
<hidden type="int">0</hidden>
<max_length></max_length>
<max_linelength></max_linelength>
<max_lines></max_lines>
<required type="int">0</required>
<title>Vtement</title>
<width type="int">40</width>
</values>
<tales>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="too_many_lines">You entered too many lines.</message>
<message name="line_too_long">A line was too long.</message>
<message name="too_long">You entered too many characters.</message>
</messages>
</field>
<field><id>my_description</id> <type>TextAreaField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default></default>
<description></description>
<external_validator></external_validator>
<extra></extra>
<height type="int">3</height>
<hidden type="int">0</hidden>
<max_length></max_length>
<max_linelength></max_linelength>
<max_lines></max_lines>
<required type="int">0</required>
<title>Description</title>
<width type="int">40</width>
</values>
<tales>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="too_many_lines">You entered too many lines.</message>
<message name="line_too_long">A line was too long.</message>
<message name="too_long">You entered too many characters.</message>
</messages>
</field>
<field><id>my_forme_id_list</id> <type>LinesField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default type="list">[]</default>
<description></description>
<external_validator></external_validator>
<extra></extra>
<height type="int">5</height>
<hidden type="int">0</hidden>
<max_length></max_length>
<max_linelength></max_linelength>
<max_lines></max_lines>
<required type="int">0</required>
<title>Formes concernes</title>
<width type="int">40</width>
</values>
<tales>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="too_many_lines">You entered too many lines.</message>
<message name="line_too_long">A line was too long.</message>
<message name="too_long">You entered too many characters.</message>
</messages>
</field>
<field><id>my_correspondance_id</id> <type>LinesField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default type="list">[]</default>
<description></description>
<external_validator></external_validator>
<extra></extra>
<height type="int">5</height>
<hidden type="int">0</hidden>
<max_length></max_length>
<max_linelength></max_linelength>
<max_lines></max_lines>
<required type="int">0</required>
<title>Correspondances mesures</title>
<width type="int">40</width>
</values>
<tales>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="too_many_lines">You entered too many lines.</message>
<message name="line_too_long">A line was too long.</message>
<message name="too_long">You entered too many characters.</message>
</messages>
</field>
<field><id>my_reset</id> <type>CheckBoxField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default type="int">1</default>
<description></description>
<external_validator></external_validator>
<extra></extra>
<hidden type="int">0</hidden>
<title>Recherche globale</title>
</values>
<tales>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
</messages>
</field>
</fields>
</group>
<group>
<title>right</title>
<fields>
<field><id>my_taille_list</id> <type>MultiListField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default type="list">[]</default>
<description></description>
<external_validator></external_validator>
<extra></extra>
<hidden type="int">0</hidden>
<items type="list">[]</items>
<required type="int">0</required>
<size type="int">6</size>
<title>Plage de tailles</title>
</values>
<tales>
<default>here/getTailleList</default>
<items>here/portal_categories/taille/getFormItemList</items>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="unknown_selection">You selected an item that was not in the list.</message>
</messages>
</field>
<field><id>my_mesure_vetement_list</id> <type>MultiListField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default type="list">[]</default>
<description></description>
<external_validator></external_validator>
<extra></extra>
<hidden type="int">0</hidden>
<items type="list">[]</items>
<required type="int">0</required>
<size type="int">7</size>
<title>Mesures Coramy</title>
</values>
<tales>
<default>here/getMesureVetementList</default>
<items>here/portal_categories/mesure_vetement/getFormItemList</items>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="unknown_selection">You selected an item that was not in the list.</message>
</messages>
</field>
<field><id>my_etat</id> <type>StringField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default></default>
<description></description>
<display_maxwidth></display_maxwidth>
<display_width type="int">20</display_width>
<external_validator></external_validator>
<extra></extra>
<hidden type="int">0</hidden>
<max_length></max_length>
<required type="int">0</required>
<title>Etat</title>
<truncate type="int">0</truncate>
</values>
<tales>
<default>python:here.portal_workflow.getInfoFor(here, 'forme_state')</default>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="too_long">Too much input was given.</message>
</messages>
</field>
<field><id>my_list_form_id</id> <type>StringField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default></default>
<description></description>
<display_maxwidth></display_maxwidth>
<display_width type="int">20</display_width>
<external_validator></external_validator>
<extra></extra>
<hidden type="int">1</hidden>
<max_length></max_length>
<required type="int">0</required>
<title></title>
<truncate type="int">0</truncate>
</values>
<tales>
<default>python:here.REQUEST.form_id</default>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="too_long">Too much input was given.</message>
</messages>
</field>
<field><id>my_list_method_id</id> <type>StringField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default>Vetement_categorySearchSql</default>
<description></description>
<display_maxwidth></display_maxwidth>
<display_width type="int">20</display_width>
<external_validator></external_validator>
<extra></extra>
<hidden type="int">1</hidden>
<max_length></max_length>
<required type="int">0</required>
<title>x</title>
<truncate type="int">0</truncate>
</values>
<tales>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="too_long">Too much input was given.</message>
</messages>
</field>
</fields>
</group>
</groups>
</form>
\ No newline at end of file
<dtml-comment>
title:
connection_id:MySQL
max_rows:1000
max_cache:100
cache_time:0
class_name:ZSQLBrain
class_file:zsqlbrain.py
</dtml-comment>
<params>correspondance_id=""
forme_id_list=""
mesure_vetement_list=""
taille_list=""
description=""
etat=""
id_list=""</params>
SELECT DISTINCT vetement.id, vetement.relative_url, vetement.path, vetement.Description, vetement.forme_state
FROM catalog AS vetement
<dtml-if expr="_.len(correspondance_id)>0">
<dtml-if expr="not (_.len(correspondance_id)==1 and correspondance_id[0]=='')">
, catalog AS catal1 JOIN category AS cat1 ON catal1.uid=cat1.category_uid
</dtml-if>
</dtml-if>
<dtml-if expr="_.len(forme_id_list)>0">
<dtml-if expr="not (_.len(forme_id_list)==1 and forme_id_list[0]=='')">
, catalog AS catal2 JOIN category AS cat2 ON catal2.uid=cat2.category_uid
</dtml-if>
</dtml-if>
<dtml-if expr="_.len(mesure_vetement_list)>0">
<dtml-if expr="not (_.len(mesure_vetement_list)==1 and mesure_vetement_list[0]=='')">
, category AS cat3
</dtml-if>
</dtml-if>
<dtml-if expr="_.len(taille_list)>0">
<dtml-if expr="not (_.len(taille_list)==1 and taille_list[0]=='')">
, category AS cat4
</dtml-if>
</dtml-if>
WHERE vetement.portal_type = "Vetement"
<dtml-if expr="_.len(id_list)>0">
AND ( vetement.id LIKE "<dtml-var expr="id_list[0]">"
<dtml-in prefix="loop" expr="_.range(_.len(id_list)-1)">
OR vetement.id LIKE "<dtml-var expr="id_list[loop_item+1]">"
</dtml-in>
)
</dtml-if>
<dtml-if expr="_.len(correspondance_id)>0">
<dtml-if expr="not (_.len(correspondance_id)==1 and correspondance_id[0]=='')">
AND cat1.uid=vetement.uid
AND cat1.base_category_uid=<dtml-var "portal_categories.specialise.uid">
AND catal1.portal_type = "Correspondance mesures"
AND ( (catal1.id LIKE "<dtml-var expr="correspondance_id[0]">")
<dtml-in prefix="loop" expr="_.range(_.len(correspondance_id)-1)">
OR (catal1.id LIKE "<dtml-var expr="correspondance_id[loop_item+1]">")
</dtml-in>
)
</dtml-if>
</dtml-if>
<dtml-if expr="_.len(forme_id_list)>0">
<dtml-if expr="not (_.len(forme_id_list)==1 and forme_id_list[0]=='')">
AND cat2.uid=vetement.uid
AND cat2.base_category_uid=<dtml-var "portal_categories.specialise.uid">
AND catal2.portal_type = "Forme"
AND ( (catal2.id LIKE "<dtml-var expr="forme_id_list[0]">")
<dtml-in prefix="loop" expr="_.range(_.len(forme_id_list)-1)">
OR (catal2.id LIKE "<dtml-var expr="forme_id_list[loop_item+1]">")
</dtml-in>
)
</dtml-if>
</dtml-if>
<dtml-if expr="_.len(mesure_vetement_list)>0">
<dtml-if expr="not (_.len(mesure_vetement_list)==1 and mesure_vetement_list[0]=='')">
AND cat3.uid=vetement.uid
AND ( cat3.category_uid=<dtml-var expr="identify_category(base_category='mesure_vetement',category=mesure_vetement_list[0])">
<dtml-in prefix="loop" expr="_.range(_.len(mesure_vetement_list)-1)">
OR cat3.category_uid=<dtml-var expr="identify_category(base_category='mesure_vetement',category=mesure_vetement_list[loop_item+1])">
</dtml-in>
)
AND cat3.base_category_uid=<dtml-var "portal_categories.mesure_vetement.uid">
</dtml-if>
</dtml-if>
<dtml-if expr="_.len(taille_list)>0">
<dtml-if expr="not (_.len(taille_list)==1 and taille_list[0]=='')">
AND cat4.uid=vetement.uid
AND ( cat4.category_uid=<dtml-var expr="identify_category(base_category='taille',category=taille_list[0])">
<dtml-in prefix="loop" expr="_.range(_.len(taille_list)-1)">
OR cat4.category_uid=<dtml-var expr="identify_category(base_category='taille',category=taille_list[loop_item+1])">
</dtml-in>
)
AND cat4.base_category_uid=<dtml-var "portal_categories.taille.uid">
</dtml-if>
</dtml-if>
<dtml-if expr="not(etat=='')">
AND vetement.vetement_state LIKE "<dtml-var expr="etat">"
</dtml-if>
<dtml-if expr="not(description=='')">
AND vetement.Description LIKE "<dtml-var expr="description">"
</dtml-if>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Vetements</title>
<link rel=stylesheet type="text/css" href="http://erp5.coramy.fr/coramy/thumbnail.css" />
</head>
<body tal:define="vetement_list python:here.object_action_list(selection_name='vetement_selection')">
<h1>Dessins techniques des vtements slectionns</h1>
<div class="container">
<tal:block tal:repeat="vetement python:vetement_list">
<div class="float" tal:define="dessin_list python:vetement.contentValues(filter={'portal_type':'Dessin Technique'})">
<a href="/" tal:attributes="href python:vetement.absolute_url()">
<tal:block tal:condition="python: len(dessin_list)>0">
<img class="image" src="logo.gif" alt="Dessin technique" tal:attributes="src python:dessin_list[0].absolute_url() + '?display=small&format=jpeg&resolution=150'" />
</tal:block>
<tal:block tal:condition="python: len(dessin_list)==0">
<p>Pas de dessin associ</p>
</tal:block>
<p tal:content="python:vetement.getId()" />
</a>
</div>
</tal:block>
<hr />
</div>
</body>
</html>
<dtml-comment>
title:
connection_id:MySQL
max_rows:10000
max_cache:100
cache_time:0
class_name:ZSQLBrain
class_file:zsqlbrain.py
</dtml-comment>
<params>uid</params>
select resource.relative_url, resource.path, resource.portal_type, resource.description from catalog, category, catalog as resource
where catalog.uid = category.category_uid
and category.uid = resource.uid
and category.base_category_uid = <dtml-var "portal_categories.specialise.uid">
and catalog.uid = <dtml-var uid>
and ( resource.portal_type = "Modele"
or resource.portal_type = "Variante Morphologique" )
\ No newline at end of file
## Script (Python) "assortiment_list_export"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=
##title=
##
selection = context.portal_selections.getSelectionFor('assortiment_selection',REQUEST=context.REQUEST)
modele_list = selection(context=context)
request = context.REQUEST
for modele_item in modele_list:
modele=modele_item.getObject()
if modele <> None :
ligne_modele = ''
ligne_modele += str(modele.getId())+'\t'
ligne_modele += str(modele.getCollection())+'\t'
print ligne_modele
request.RESPONSE.setHeader('Content-Type','application/text')
return printed
<?xml version="1.0" encoding="iso-8859-1"?>
<form>
<title>Vetement</title>
<name>vetement_view</name>
<action>base_edit</action>
<enctype></enctype>
<method>POST</method>
<pt>form_view</pt>
<groups>
<group>
<title>left</title>
<fields>
<field><id>my_id</id> <type>StringField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default></default>
<description></description>
<display_maxwidth></display_maxwidth>
<display_width type="int">20</display_width>
<external_validator></external_validator>
<extra></extra>
<hidden type="int">0</hidden>
<max_length></max_length>
<required type="int">1</required>
<title>Vtement</title>
<truncate type="int">0</truncate>
</values>
<tales>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="too_long">Too much input was given.</message>
</messages>
</field>
<field><id>my_librairie</id> <type>StringField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default></default>
<description></description>
<display_maxwidth></display_maxwidth>
<display_width type="int">20</display_width>
<external_validator></external_validator>
<extra></extra>
<hidden type="int">0</hidden>
<max_length></max_length>
<required type="int">0</required>
<title>Fichier Lectra</title>
<truncate type="int">0</truncate>
</values>
<tales>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="too_long">Too much input was given.</message>
</messages>
</field>
<field><id>my_description</id> <type>TextAreaField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default></default>
<description></description>
<external_validator></external_validator>
<extra></extra>
<height type="int">3</height>
<hidden type="int">0</hidden>
<max_length></max_length>
<max_linelength></max_linelength>
<max_lines></max_lines>
<required type="int">0</required>
<title>Description</title>
<width type="int">40</width>
</values>
<tales>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="too_many_lines">You entered too many lines.</message>
<message name="line_too_long">A line was too long.</message>
<message name="too_long">You entered too many characters.</message>
</messages>
</field>
<field><id>my_forme_id_list</id> <type>MultiRelationStringField</type>
<values>
<alternate_name></alternate_name>
<base_category>specialise</base_category>
<catalog_index>id</catalog_index>
<css_class></css_class>
<default type="list">[]</default>
<default_module>forme</default_module>
<description></description>
<external_validator></external_validator>
<extra></extra>
<height type="int">5</height>
<hidden type="int">0</hidden>
<jump_method>base_jump_relation</jump_method>
<max_length></max_length>
<max_linelength></max_linelength>
<max_lines></max_lines>
<portal_type type="list">[('Forme', 'Forme')]</portal_type>
<required type="int">0</required>
<title>Formes concernes</title>
<update_method>base_update_relation</update_method>
<width type="int">20</width>
</values>
<tales>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="too_many_lines">You entered too many lines.</message>
<message name="line_too_long">A line was too long.</message>
<message name="too_long">You entered too many characters.</message>
</messages>
</field>
<field><id>my_base_taille</id> <type>ListField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default></default>
<description></description>
<external_validator></external_validator>
<extra></extra>
<first_item type="int">0</first_item>
<hidden type="int">0</hidden>
<items type="list">[]</items>
<required type="int">0</required>
<size type="int">1</size>
<title>Taille de base</title>
</values>
<tales>
<items>here/portal_categories/taille/getFormItemList</items>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="unknown_selection">You selected an item that was not in the list.</message>
</messages>
</field>
<field><id>my_correspondance_id</id> <type>RelationStringField</type>
<values>
<alternate_name></alternate_name>
<base_category>specialise</base_category>
<catalog_index>id</catalog_index>
<css_class></css_class>
<default></default>
<default_module>correspondance_mesures</default_module>
<description></description>
<display_maxwidth></display_maxwidth>
<display_width type="int">20</display_width>
<external_validator></external_validator>
<extra></extra>
<hidden type="int">0</hidden>
<jump_method>base_jump_relation</jump_method>
<max_length></max_length>
<portal_type type="list">[('Correspondance Mesures', 'Correspondance Mesures')]</portal_type>
<required type="int">0</required>
<title>Correspondance mesures</title>
<truncate type="int">0</truncate>
<update_method>base_update_relation</update_method>
</values>
<tales>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="too_long">Too much input was given.</message>
</messages>
</field>
<field><id>vetement_state</id> <type>StringField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default></default>
<description></description>
<display_maxwidth></display_maxwidth>
<display_width type="int">20</display_width>
<external_validator></external_validator>
<extra></extra>
<hidden type="int">0</hidden>
<max_length></max_length>
<required type="int">0</required>
<title>Etat</title>
<truncate type="int">0</truncate>
</values>
<tales>
<default>python:here.portal_workflow.getInfoFor(here, 'vetement_state')</default>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="too_long">Too much input was given.</message>
</messages>
</field>
</fields>
</group>
<group>
<title>right</title>
<fields>
<field><id>my_taille_list</id> <type>MultiListField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default type="list">[]</default>
<description></description>
<external_validator></external_validator>
<extra></extra>
<hidden type="int">0</hidden>
<items type="list">[]</items>
<required type="int">0</required>
<size type="int">6</size>
<title>Plage de tailles</title>
</values>
<tales>
<default>here/getTailleList</default>
<items>here/portal_categories/taille/getFormItemList</items>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="unknown_selection">You selected an item that was not in the list.</message>
</messages>
</field>
<field><id>my_mesure_vetement_list</id> <type>MultiListField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default type="list">[]</default>
<description></description>
<external_validator></external_validator>
<extra></extra>
<hidden type="int">0</hidden>
<items type="list">[]</items>
<required type="int">0</required>
<size type="int">7</size>
<title>Mesures Coramy</title>
</values>
<tales>
<default>here/getMesureVetementList</default>
<items>here/portal_categories/mesure_vetement/getFormItemList</items>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="unknown_selection">You selected an item that was not in the list.</message>
</messages>
</field>
</fields>
</group>
<group>
<title>center</title>
<fields>
</fields>
</group>
<group>
<title>bottom</title>
<fields>
<field><id>listbox</id> <type>ListBox</type>
<values>
<all_columns type="list">[]</all_columns>
<all_editable_columns type="list">[]</all_editable_columns>
<alternate_name></alternate_name>
<columns type="list">[('relative_url', 'Document'), ('portal_type', 'Type'), ('description', 'Description')]</columns>
<css_class></css_class>
<default></default>
<default_params type="list">[]</default_params>
<description></description>
<domain_root_list type="list">[]</domain_root_list>
<domain_tree type="int">0</domain_tree>
<editable_columns type="list">[]</editable_columns>
<external_validator></external_validator>
<global_attributes type="list">[]</global_attributes>
<hidden type="int">0</hidden>
<lines type="int">10</lines>
<list_action>list</list_action>
<list_method type="method">Vetement_zGetRelatedModeleList</list_method>
<meta_types type="list">[]</meta_types>
<portal_types type="list">[('Modele', 'Modele'), ('Variante Morphologique', 'Variante Morphologique')]</portal_types>
<report_root_list type="list">[]</report_root_list>
<report_tree type="int">0</report_tree>
<search type="int">0</search>
<search_columns type="list">[]</search_columns>
<select type="int">0</select>
<selection_name>related_modele_selection</selection_name>
<sort type="list">[]</sort>
<stat_method></stat_method>
<title>Modles concerns</title>
</values>
<tales>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
</messages>
</field>
</fields>
</group>
</groups>
</form>
\ No newline at end of file
<dtml-comment>
title:
connection_id:MySQL
max_rows:10000
max_cache:100
cache_time:0
class_name:ZSQLBrain
class_file:zsqlbrain.py
</dtml-comment>
<params></params>
SELECT DISTINCT catalog.relative_url, catalog.title, catalog.path, catalog.id
FROM catalog, catalog as resource, category
WHERE catalog.portal_type = "Organisation"
AND resource.portal_type = "Tissu"
AND category.uid = resource.uid
AND category.base_category_uid = <dtml-var "portal_categories.source.uid">
AND category.category_uid = catalog.uid
\ No newline at end of file
<dtml-comment>
title:
connection_id:MySQL
max_rows:1000
max_cache:100
cache_time:0
class_name:ZSQLBrain
class_file:zsqlbrain.py
</dtml-comment>
<params>uid
sort_on</params>
SELECT
container_cell.uid, container_cell.Id, container_cell.path, container_cell.Description, movement.variation_text
FROM
catalog AS container_cell, catalog AS container_line, movement
WHERE
((
container_cell.parent_uid = container_line.uid
AND
container_line.parent_uid = <dtml-sqlvar uid type="int">
AND
movement.uid = container_cell.uid
AND
container_cell.portal_type = "Container Cell"
)
OR
(
container_line.parent_uid = <dtml-sqlvar uid type="int">
AND
container_line.uid = container_cell.uid
AND
movement.uid = container_cell.uid
AND
movement.has_cell_content = 0
AND
container_line.portal_type = "Container Line"
))
AND container_cell.portal_type <> "Container"
<dtml-if sort_on>ORDER BY
<dtml-var sort_on>
</dtml-if>
\ No newline at end of file
## Script (Python) "DeliveryLine_getCorrespondanceDict"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=
##title=
##
delivery_line = context
correspondance_dict = {}
if delivery_line.hasCellContent() :
variation_base_category_list = delivery_line.getVariationBaseCategoryList()
for base_category in variation_base_category_list :
correspondance_dict[base_category] = {}
for cell in delivery_line.contentValues(filter={'portal_type' : ['Delivery Cell', 'Invoice Cell']}) :
if 'coloris' in variation_base_category_list :
correspondance_dict['coloris']['coloris/'+cell.getColoris()] = cell.Amount_getColorisClient()
if 'taille' in variation_base_category_list :
if 'morphologie' in variation_base_category_list :
correspondance_dict['taille']['taille/'+cell.getTaille()+'morphologie/'+cell.getMorphologie()] = cell.Amount_getTailleClient()
else :
correspondance_dict['taille']['taille/'+cell.getTaille()] = cell.Amount_getTailleClient()
if 'morphologie' in variation_base_category_list :
correspondance_dict['morphologie']['morphologie/'+cell.getMorphologie()] = cell.getMorphologieValue().getMorphoTypeTitle()
return correspondance_dict
## Script (Python) "Invoice_zGetDescription"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=
##title=
##
from string import join
description = context.getComment('')
return description
# Try to cut the comment without cutting the words
# pbl: capital letter are larger, and the test on the length of sentence isn't good ...
def recursive_string_cut(b,s):
l = 80
if len(s) < l:
return b+s
else:
c = s[:l].split(' ')
if len(c) < 2:
# I don't think that a word with more than 80 caracters can exist ... and it can crash the memory
return s[:l]
else:
return recursive_string_cut(b+join(c[:-2],' ')+'\n', join(c[-2:],' ')+s[l:] )
# get all the lines
description_lines = description.split('\n')
# cut the too long lines
result_description_lines = map( ( lambda x: recursive_string_cut('',x) ),description_lines)
# recreate a string
result = join(result_description_lines,'\n')
return result
## Script (Python) "Invoice_zGetDueDate"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=
##title=
##
packing_list = context.getCausalityValueList(portal_type=['Sale Packing List','Sales Packing List'])[0]
order = packing_list.getCausalityValueList(portal_type=['Sale Order','Sales Order'])[0]
"""
trade_ref = order.getTradeDateId()
case = {
'Facture':context.getStartDate,
'Commande':order.getStartDate,
'Livraison':packing_list.getTargetStopDate
}
ref_date = case[trade_ref]()
"""
from DateTime import DateTime
due_date = packing_list.getTargetStopDate( DateTime() )
due_date += context.getPaymentTerm(30)
peom = context.getPaymentEndOfMonth()
pat = order.getPaymentAdditionalTerm()
if peom:
i = 0
month = due_date.month()
while (month == (due_date + i).month()):
i += 1
due_date = (due_date + i - 1)
if pat != None:
due_date += pat
else:
if pat != None:
i = 0
month = due_date.month()
while (month == (due_date + i).month()):
i -= 1
due_date = (due_date + i + pat)
return due_date
## Script (Python) "Invoice_zGetEscompteDescription"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=
##title=
##
tmp_list = context.contentValues(filter={'portal_type':'Remise', 'discount_type_title':'Escompte'})
escompte_list = filter(lambda item: item.getDiscountType() == 'Escompte', tmp_list)
if escompte_list != []:
escompte_object = escompte_list[0]
if escompte_object.getDescription() != None:
escompte_description = string.replace(escompte_object.getDescription(),'%','%%')[:45]
elif escompte_object.getDiscountRatio() != None:
escompte_description = '%.2f' % (escompte_object.getDiscountRatio() * 100) + '%% sous 10 jours'
else:
escompte_description = '2%% sous 10 jours'
else:
escompte_description = '2%% sous 10 jours'
return escompte_description
## Script (Python) "Invoice_zGetPaymentTime"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=
##title=
##
packing_list = context.getCausalityValueList(portal_type=['Sale Packing List','Sales Packing List'])[0]
order = packing_list.getCausalityValueList(portal_type=['Sale Order','Sales Order'])[0]
payment_term = context.getPaymentTerm(30)
payment_end_of_month = context.getPaymentEndOfMonth()
pat = order.getPaymentAdditionalTerm()
result = '%i jours ' % payment_term
if pat == None:
if payment_end_of_month:
result += 'en fin de mois'
else:
result += 'net'
else:
result += 'le %i' % pat
return result
## Script (Python) "Invoice_zGetSourceSectionDescription"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=
##title=
##
source_section_title = context.getSourceSectionTitle()
case = {
'Coramy': ('Coramy',
'5 bis, rue Denis Cordonnier - 59820 Gravelines - Tél. : 33(0)3 28 51 91 51 - Fax : 33(0)3 28 23 34 96',
'MAILLOTS DE BAIN - GYM - SWIMSUITS - FITNESS',
'S.A.S. au capital de 435.200 € - T.V.A. FR 67 611 750 274 - R.C. Dunkerque 611 750 274 - SIRET 611 750 274 00023 - CNUF 15971',
'40'),
'BLS': ('BLS' ,
'5 bis, rue Denis Cordonnier - 59820 Gravelines - Tél. : 33(0)3 28 51 86 26 - Fax : 33(0)3 28 23 34 96',
'LICENSE MAILLOTS DE BAIN DIM FEMME & HOMME',
'S.A.R.L. au capital de 10.000 € - T.V.A. FR 51 442 959 243 - R.C. Dunkerque 442 959 243 - SIRET 442 959 243 00019'
'60'),
'Houvenaegel':('Houvenaegel' ,
'5 bis, rue Denis Cordonnier - 59820 Gravelines - Tél. : 33(0)3 28 51 91 55 - Fax : 33(0)3 28 23 34 96',
'MAILLOTS DE BAIN - GYM - SWIMSUITS - FITNESS',
'S.A.R.L. au capital de 7.622,45 € - T.V.A. FR 07 422 769 810 - R.C. Dunkerque 422 769 810 - SIRET 422 769 810 00025',
'20')
}
return case[ source_section_title ]
<dtml-comment>
title:
connection_id:MySQL
max_rows:100000
max_cache:100
cache_time:0
class_name:ZSQLBrain
class_file:zsqlbrain.py
</dtml-comment>
<params>uid</params>
SELECT sum(movement.quantity) AS total_quantity, sum(movement.total_price) AS total_price from movement
WHERE movement.delivery_uid = <dtml-var uid>
AND movement.has_cell_content = 0
\ No newline at end of file
## Script (Python) "Invoice_zGetTotalNetPrice"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=
##title=
##
# price = context.getTotalPrice()
price = context.Invoice_zGetTotal()[0].total_price
discount_list_tmp = context.contentValues(filter={'portal_type':'Remise'})
discount_list = filter(lambda x: x not in [None,0] ,discount_list_tmp)
if len(discount_list) > 1:
discount_list.sort(lambda x,y: cmp(x.getIntIndex(),y.getIntIndex()))
for discount_line in discount_list:
if discount_line.getImmediateDiscount():
price *= (1 - discount_line.getDiscountRatio())
return price
## Script (Python) "Invoice_zGetTotalVat"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=
##title=
##
price = context.Invoice_zGetTotalNetPrice()
if context.getValueAddedTaxRecoverable():
vat_ratio = context.getValueAddedTaxRatio()
if vat_ratio != None:
price *= vat_ratio
else:
price = 0
else:
price = 0
return price
<dtml-comment>
title:
connection_id:MySQL
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params>uid
total_asset_price</params>
UPDATE
stock LEFT JOIN movement ON (stock.uid = movement.uid)
SET
stock.total_asset_price = <dtml-sqlvar total_asset_price type="float">
WHERE
stock.uid = <dtml-sqlvar uid type="int">
AND
( movement.quantity > 0 AND stock.quantity > 0
OR movement.quantity < 0 AND stock.quantity < 0)
\ No newline at end of file
<dtml-comment>
title:
connection_id:MySQL
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params>uid
total_asset_price</params>
UPDATE
stock LEFT JOIN movement ON (stock.uid = movement.uid)
SET
stock.total_asset_price = <dtml-sqlvar total_asset_price type="float">
WHERE
stock.uid = <dtml-sqlvar uid type="int">
AND
( movement.quantity > 0 AND stock.quantity < 0
OR movement.quantity < 0 AND stock.quantity > 0)
\ No newline at end of file
<?xml version="1.0" encoding="iso-8859-1"?>
<form>
<title>Liste de commandes</title>
<name>sales_order_list</name>
<action></action>
<enctype></enctype>
<method>POST</method>
<pt>form_list</pt>
<groups>
<group>
<title>Default</title>
<fields>
<field><id>listbox</id> <type>ListBox</type>
<values>
<all_columns type="list">[('id', 'Commande'), ('default_destination_section_title', 'Soci\xe9t\xe9'), ('default_source_title', 'Exp\xe9di\xe9 par'), ('default_destination_title', 'Livrer \xe0'), ('default_destination_administration_person_title', 'Gestionaire'), ('target_stop_date', 'Livraison demand\xe9e'), ('stop_date', 'Livraison confirm\xe9e'), ('simulation_state', 'Etat')]</all_columns>
<all_editable_columns type="list">[]</all_editable_columns>
<alternate_name></alternate_name>
<columns type="list">[('target_stop_date', 'Date Livraison'), ('node_title', 'Fournisseur'), ('resource_title', 'Composant'), ('variation_text', 'Variante'), ('target_quantity', 'Quantit\xe9 command\xe9e'), ('getCurrentInventory', 'Stock'), ('getAvailableInventory', 'Dispo'), ('getFutureInventory', 'Futur')]</columns>
<css_class></css_class>
<default></default>
<default_params type="list">[]</default_params>
<description></description>
<domain_root_list type="list">[('portal_categories/type_composant', 'Type Composant'), ('portal_categories/quantity_unit', 'Unit\xe9 Composant'), ('portal_categories/site', 'Site')]</domain_root_list>
<domain_tree type="int">0</domain_tree>
<editable_columns type="list">[]</editable_columns>
<external_validator></external_validator>
<global_attributes type="list">[]</global_attributes>
<hidden type="int">0</hidden>
<lines type="int">30</lines>
<list_action>list</list_action>
<list_method type="method">portal_catalog</list_method>
<meta_types type="list">[]</meta_types>
<portal_types type="list">[('Purchase Order', 'Purchase Order')]</portal_types>
<report_root_list type="list">[]</report_root_list>
<report_tree type="int">0</report_tree>
<search type="int">1</search>
<search_columns type="list">[('node_title', 'node_title'), ('resource_title', 'resource_title'), ('target_stop_date', 'target_stop_date'), ('variation_text', 'variation_text')]</search_columns>
<select type="int">1</select>
<selection_name>purchase_report_selection</selection_name>
<sort type="list">[]</sort>
<sort_columns type="list">[]</sort_columns>
<stat_method></stat_method>
<title>Commandes achat</title>
</values>
<tales>
<list_method>python:here.getPortalObject().portal_skins.local_list_method[here.REQUEST.list_method_id]</list_method>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
</messages>
</field>
</fields>
</group>
</groups>
</form>
\ No newline at end of file
<?xml version="1.0" encoding="iso-8859-1"?>
<form>
<title>Ne pas utiliser, ca ne marche pas encore ...</title>
<name>SaleInvoice_dateSearch</name>
<action>sales_invoice_list</action>
<enctype></enctype>
<method>POST</method>
<pt>form_view_dialog</pt>
<groups>
<group>
<title>left</title>
<fields>
<field><id>my_start_date</id> <type>DateTimeField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<date_only type="int">1</date_only>
<date_separator>/</date_separator>
<default>2004/02/27 16:46:00 GMT+1</default>
<default_now type="int">0</default_now>
<description></description>
<external_validator></external_validator>
<hidden type="int">0</hidden>
<input_order>dmy</input_order>
<input_style>list</input_style>
<required type="int">1</required>
<time_separator>:</time_separator>
<title>Date de facture</title>
</values>
<tales>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="not_datetime">You did not enter a valid date and time.</message>
<message name="datetime_out_of_range">The date and time you entered were out of range.</message>
</messages>
</field>
</fields>
</group>
<group>
<title>right</title>
<fields>
</fields>
</group>
</groups>
</form>
\ No newline at end of file
## Script (Python) "SaleInvoice_exportSage"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=batch_mode=0,cr='\r',**kw
##title=
##
# generate a export file from a Sale Invoice for the Sage software
def priceWrite(price):
from string import zfill
s = '%.2f' % price
width = 13
if len(s) > width:
result = s[-width:]
else:
result = zfill(s,width)
return result
def mecg_text(invoice_date, datetime, invoice_number, compta_number, code_comptable, corporate_name, due_date):
content = '#MECG'+cr
content += 'VE'+cr
content += invoice_date+cr
content += datetime+cr
content += invoice_number+(cr*3)
content += compta_number+(cr*2)
content += code_comptable+(cr*2)
content += corporate_name+cr
content += '0'+cr
content += due_date+cr
content += (('0'+cr)*3)
return content
def mecg_text_part2(is_invoice, amount):
content = ''
content += is_invoice+cr
content += priceWrite(amount)+cr
content += (cr*3)+(('0'+cr)*5)
return content
def meca_text(amount):
content = '#MECA'+cr
content += '1'+cr
content += 'VENTES'+cr
content += priceWrite(amount)+cr
content += '0'+cr
return content
request = context.REQUEST
file_content = ''
# globals variables
invoice_date = context.getStartDate().strftime('%d%m%y')
from DateTime import DateTime
datetime = DateTime().strftime('%d%m%y')
invoice_number = context.getReference()
code_comptable = context.getDestinationAdministrationValue().getCodeComptable()
corporate_name = context.getDestinationAdministrationValue().getCorporateName()
due_date = context.Invoice_zGetDueDate().strftime('%d%m%y')
if context.getValueAddedTaxRecoverable():
vat = context.Invoice_zGetTotalVat()
else:
vat = 0.0
incomeHT = context.getTotalPrice()
income = context.Invoice_zGetTotalNetPrice()
# the decimals must be corrects
payable = float('%.2f' % income) + float('%.2f' % vat);
# parameters of SaleInvoice_exportSageCodeComptableList
analytique='VENTES'
source_section_title=context.getSourceSectionTitle()
#amount_type=
region=context.getDestinationAdministrationValue().getDefaultAddressRegion()
if region == None:
region = 'France'
else:
region = region.split('/')[-1]
compte_client=context.getDestinationAdministrationValue().getCodeComptable()
if compte_client in (None, ''):
if not batch_mode:
message="Erreur+sur+la+facture:+il+n\'y+a+pas+de+compte+comptable+sur+l\'organisation+à+facturer"
redirect_url = '%s?%s%s' % ( context.absolute_url()+'/view', 'portal_status_message=',message)
request[ 'RESPONSE' ].redirect( redirect_url )
return None
else:
return None
# only the lasts 5 letters are usable
compte_client = compte_client[-5:]
cee_region_list = [
'Belgique',
'Danemark',
'Allemagne',
'Grece',
'Espagne',
'France',
'Irlande',
'Italie',
'Luxembourg',
'Pays-Bas',
'Autriche',
'Portugal',
'Finlande',
'Suede',
'Grande-Bretagne',
'Tchequie',
'Estonie',
'Chypre',
'Letonie',
'Lituanie',
'Hongrie',
'Malte',
'Pologne',
'Slovenie',
'Slovaquie'
]
if region in cee_region_list:
if region == 'France':
location = region
else:
location = 'CEE'
else:
location = 'HCEE'
# TTC
amount_type='TTC'
compta_number = '4110000'
code_comptable = context.SaleInvoice_exportSageCodeComptableList(analytique, source_section_title, amount_type, location, compte_client)
is_invoice = '0'
#amount = '%s' % payable
amount = payable
file_content += mecg_text(invoice_date=invoice_date, datetime=datetime, invoice_number=invoice_number, compta_number=compta_number, code_comptable=code_comptable, corporate_name=corporate_name, due_date=due_date)
file_content += mecg_text_part2(is_invoice=is_invoice, amount=amount)
# HT
amount_type='HT'
compta_number = context.SaleInvoice_exportSageCodeComptableList(analytique, source_section_title, amount_type, location, compte_client)
code_comptable = ''
is_invoice = '1'
#amount = '%s' % incomeHT
amount = incomeHT
file_content += mecg_text(invoice_date=invoice_date, datetime=datetime, invoice_number=invoice_number, compta_number=compta_number, code_comptable=code_comptable, corporate_name=corporate_name, due_date=due_date)
file_content += mecg_text_part2(is_invoice=is_invoice, amount=amount)
file_content += meca_text(amount=amount)
# discount
discount_list_tmp = context.contentValues(filter={'portal_type':'Remise'})
discount_list_tmp2 = filter(lambda x: x not in [None,0] ,discount_list_tmp)
discount_list = filter(lambda x: x.getImmediateDiscount(), discount_list_tmp2 )
if len(discount_list) > 1:
discount_list.sort(lambda x,y: cmp(y.getIntIndex(),x.getIntIndex()))
income_old = income
income_new = 0
discount_total = 0
did_we_have_another_discount = 0
for discount_line in discount_list:
if discount_line.getDiscountTypeTitle() == 'Escompte':
# escompte
amount_type='escompte'
compta_number = context.SaleInvoice_exportSageCodeComptableList(analytique, source_section_title, amount_type, location, compte_client)
code_comptable = ''
income_new = income_old / (1 - discount_line.getDiscountRatio())
discount_total += income_new - income_old
remise_price = income_new - income_old
income_old = income_new
amount = remise_price
is_invoice = '0'
file_content += mecg_text(invoice_date=invoice_date, datetime=datetime, invoice_number=invoice_number, compta_number=compta_number, code_comptable=code_comptable, corporate_name=corporate_name, due_date=due_date)
file_content += mecg_text_part2(is_invoice=is_invoice, amount=amount)
file_content += meca_text(amount=amount)
else:
# all others discounts
did_we_have_another_discount = 1
income_new = income_old / (1 - discount_line.getDiscountRatio())
discount_total += income_new - income_old
income_old = income_new
if did_we_have_another_discount:
amount_type='discount'
compta_number = context.SaleInvoice_exportSageCodeComptableList(analytique, source_section_title, amount_type, location, compte_client)
code_comptable = ''
amount = discount_total
is_invoice = '0'
file_content += mecg_text(invoice_date=invoice_date, datetime=datetime, invoice_number=invoice_number, compta_number=compta_number, code_comptable=code_comptable, corporate_name=corporate_name, due_date=due_date)
file_content += mecg_text_part2(is_invoice=is_invoice, amount=amount)
file_content += meca_text(amount=amount)
# VAT
amount_type='tva'
compta_number = context.SaleInvoice_exportSageCodeComptableList(analytique, source_section_title, amount_type, location, compte_client)
code_comptable = ''
is_invoice = '1'
amount = vat
file_content += mecg_text(invoice_date=invoice_date, datetime=datetime, invoice_number=invoice_number, compta_number=compta_number, code_comptable=code_comptable, corporate_name=corporate_name, due_date=due_date)
file_content += mecg_text_part2(is_invoice=is_invoice, amount=amount)
# and this is the end ....
if batch_mode:
return file_content
else:
# add the header and the end of the file
file = '#FLG 000'+cr
file += '#VER 5'+cr
file += file_content
file += '#FIN'
request.RESPONSE.setHeader('Content-Type','text/plain')
return file
## Script (Python) "SaleInvoice_exportSageCodeComptableList"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=analytique=None, source_section_title=None, amount_type=None, location=None, compte_client=None
##title=
##
# { analytique: { source_section_title:{ amount_type: { location: } } } }
code_comptable_dict = {
'VENTES': {
'Coramy': {
'TTC': {
'CEE': compte_client,
'HCEE': compte_client,
'France': compte_client
},
'HT': {
'France': '7011100',
'CEE': '7011200',
'HCEE': '7011300'
},
'discount': {
'France': '7091100',
'CEE': '7091200',
'HCEE': '7091300'
},
'escompte': {
'France': '6651000',
'HCEE': '6652000',
'CEE': '6653000'
},
'tva': {
'CEE': '4457102',
'HCEE': '4457102',
'France': '4457102'
},
},
'BLS': {
'TTC': {
'CEE':compte_client,
'HCEE':compte_client,
'France':compte_client
},
'HT': {
'France': '7071000',
'CEE': '7071200',
'HCEE': '7071300'
},
'discount': {
'France': '7097000',
'CEE': '7097200',
'HCEE': '7097300'
},
'escompte': {
'France': '6651000',
'HCEE': '6652000',
'CEE': '6653000'
},
'tva': {
'CEE': '4457102',
'HCEE': '4457102',
'France': '4457102'
},
},
'Houvenaegel': {
'TTC': {
'CEE': compte_client,
'HCEE': compte_client,
'France': compte_client
},
'HT': {
'France': '7071000',
'CEE': '7071200',
'HCEE': '7071300'
},
'discount': {
'France': '7097000',
'CEE': '7097200',
'HCEE': '7097300'
},
'escompte': {
'France': '6651000',
'HCEE': '6652000',
'CEE': '6653000'
},
'tva': {
'CEE': '4457102',
'HCEE': '4457102',
'France': '4457102'
},
},
}}
return code_comptable_dict[analytique][source_section_title][amount_type][location]
## Script (Python) "SaleInvoice_exportSageList"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=**kw
##title=
##
# generate a export file from a Sale Invoice list for the Sage software
request = context.REQUEST
cr='\r'
# add the header of the file
file = '#FLG 000'+cr
file += '#VER 5'+cr
object_list = context.object_action_list(selection_name='order_selection')
for invoice in object_list:
try:
file += invoice.SaleInvoice_exportSage(batch_mode=1,cr=cr)
except:
message='Erreur+sur+la+facture:+identifiant+%s+numero+%s.' % (invoice.getId(),invoice.getReference())
redirect_url = '%s?%s%s' % ( context.absolute_url()+'/view', 'portal_status_message=',message)
request[ 'RESPONSE' ].redirect( redirect_url )
# add the end of the file
file += '#FIN'
request.RESPONSE.setHeader('Content-Type','text/plain')
return file
## Script (Python) "SaleInvoice_printPdf"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=user_name='rc',printer='Xerox_DC_440',selection_name=None,render_id=None,template_id=None,number_copies=1,**kw
##title=
##
# generate a pdf file from the sale invoice
invoice = context
invoice_description = "Identifiant facture "+invoice.getId()
try:
# generate the pdf
pdf = invoice.Invoice_print_romain(batch_mode=1)
except:
context.Coramy_sendMailToUser(user_name=user_name,mSubj="Gnration d un pdf choue",mMsg=invoice_description)
else:
try:
# Send it to a printer.
invoice.sendRawToCups(printer, pdf, number_copies=number_copies)
except:
context.Coramy_sendMailToUser(user_name=user_name,mSubj="Impression d une facture vente choue",mMsg=invoice_description)
## Script (Python) "SaleInvoice_printPdfList"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=printer='Xerox_DC_440',selection_name=None,render_id=None,template_id=None,number_copies=1,**kw
##title=
##
# generate a pdf file from the sale invoice list
request = context.REQUEST
object_list = context.object_action_list(selection_name=selection_name)
# sort invoice's references
object_list.sort(lambda x,y: cmp(int(x.getReference('0')),int(y.getReference('0'))));
user_name = context.portal_membership.getAuthenticatedMember().getUserName()
for invoice in object_list:
invoice.activate(activity="SQLQueue").SaleInvoice_printPdf(user_name=user_name,printer=printer,selection_name=selection_name,render_id=render_id,template_id=template_id, number_copies=number_copies)
redirect_url = '%s?%s' % ( context.absolute_url(), 'portal_status_message=Impression+lance.')
request[ 'RESPONSE' ].redirect( redirect_url )
<?xml version="1.0" encoding="iso-8859-1"?>
<form>
<title>Confirmer l'impression</title>
<name>SaleInvoice_printPdfListForm</name>
<action>SaleInvoice_printPdfList</action>
<enctype></enctype>
<method>POST</method>
<pt>form_dialog</pt>
<groups>
<group>
<title>Default</title>
<fields>
<field><id>my_number_copies</id> <type>IntegerField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default>1</default>
<description></description>
<display_maxwidth></display_maxwidth>
<display_width type="int">20</display_width>
<end type="int">5</end>
<external_validator></external_validator>
<extra></extra>
<hidden type="int">0</hidden>
<required type="int">1</required>
<start type="int">0</start>
<title>Nombre d'exemplaires</title>
</values>
<tales>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="not_integer">You did not enter an integer.</message>
<message name="integer_out_of_range">The integer you entered was out of range.</message>
</messages>
</field>
</fields>
</group>
<group>
<title>hidden</title>
<fields>
<field><id>my_selection_name</id> <type>StringField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default>order_selection</default>
<description></description>
<display_maxwidth></display_maxwidth>
<display_width type="int">20</display_width>
<external_validator></external_validator>
<extra></extra>
<hidden type="int">1</hidden>
<max_length></max_length>
<required type="int">1</required>
<title>x</title>
<truncate type="int">0</truncate>
</values>
<tales>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="too_long">Too much input was given.</message>
</messages>
</field>
<field><id>my_printer</id> <type>StringField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default>Xerox_DC_440</default>
<description></description>
<display_maxwidth></display_maxwidth>
<display_width type="int">20</display_width>
<external_validator></external_validator>
<extra></extra>
<hidden type="int">1</hidden>
<max_length></max_length>
<required type="int">1</required>
<title>x</title>
<truncate type="int">0</truncate>
</values>
<tales>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="too_long">Too much input was given.</message>
</messages>
</field>
<field><id>my_render_id</id> <type>StringField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default></default>
<description></description>
<display_maxwidth></display_maxwidth>
<display_width type="int">20</display_width>
<external_validator></external_validator>
<extra></extra>
<hidden type="int">1</hidden>
<max_length></max_length>
<required type="int">0</required>
<title>x</title>
<truncate type="int">0</truncate>
</values>
<tales>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="too_long">Too much input was given.</message>
</messages>
</field>
<field><id>my_template_id</id> <type>StringField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default></default>
<description></description>
<display_maxwidth></display_maxwidth>
<display_width type="int">20</display_width>
<external_validator></external_validator>
<extra></extra>
<hidden type="int">1</hidden>
<max_length></max_length>
<required type="int">0</required>
<title>x</title>
<truncate type="int">0</truncate>
</values>
<tales>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="too_long">Too much input was given.</message>
</messages>
</field>
</fields>
</group>
</groups>
</form>
\ No newline at end of file
## Script (Python) "SalesOrder_countEdiSales"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=**kw
##title=
##
# Count the number of EDI sales order
number = 0
number_object = 0
number_sales_order = 0
object_list = context.object_action_list(selection_name='sales_order_selection')
for object in object_list:
number_object += 1
if object.getPortalType() == 'Sales Order':
number_sales_order += 1
print ':',
print object.getCommandeOrigine(),
if (object.getCommandeOrigine() == 'EDI'):
number += 1
print object.getId()
print '\n Total Commandes EDI: %i \n' % number
print '\n Total Commandes : %i \n' % number_object
print '\n Total Commandes Sales: %i \n' % number_sales_order
return printed
## Script (Python) "SalesOrder_importEdiFileList"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=file_path=None, delivery_mode=None, incoterm=None, order_type=None, segmentation_strategique=None, travel_duration=None, batch_mode=0
##title=
##
user_name = context.portal_membership.getAuthenticatedMember().getUserName()
request = context.REQUEST
context.activate(activity="SQLQueue").SalesOrder_importEdiFileListTestAndStart(delivery_mode=delivery_mode, incoterm=incoterm, order_type=order_type, segmentation_strategique=segmentation_strategique, travel_duration=travel_duration, user_name=user_name )
redirect_url = '%s?%s' % ( context.absolute_url()+'/'+'view', 'portal_status_message=Import+des+fichiers+EDI+lanc.')
if batch_mode:
return None
else:
request[ 'RESPONSE' ].redirect( redirect_url )
## Script (Python) "SalesOrder_reportByClient"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=source_section
##title=
##
request = context.REQUEST
cr = '\r'
tab = '\t'
report = 'Client' + 5*tab + 'Quantite' + tab + 'Prix total' + cr
source_section_item_list = source_section.split('.')
source_section_object = context.portal_categories.group
for source_item in source_section_item_list :
source_section_object = source_section_object[source_item]
report_list = context.SalesOrder_zReportByClient(source_section_uid=source_section_object.getUid())
for report_item in report_list :
if report_item.client is None :
report += '' + 5*tab
else :
client_item_list = report_item.client.split('/')
compteur = 0
for client_item in client_item_list :
report += client_item + tab
compteur +=1
for i in range(5-compteur) :
report += tab
report += str(report_item.quantity).replace('.',',') + tab
report += str(report_item.total_price).replace('.',',') + cr
request.RESPONSE.setHeader('Content-Type','application/text')
return report
<?xml version="1.0" encoding="iso-8859-1"?>
<form>
<title>Exporter</title>
<name>SalesOrder_reportByResourceForm</name>
<action>SalesOrder_reportByClient</action>
<enctype></enctype>
<method>POST</method>
<pt>form_view_dialog</pt>
<groups>
<group>
<title>Default</title>
<fields>
<field><id>my_source_section</id> <type>RadioField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default></default>
<description></description>
<external_validator></external_validator>
<first_item type="int">1</first_item>
<hidden type="int">0</hidden>
<items type="list">[('Coramy', 'Coramy'), ('BLS', 'Coramy.BLS'), ('Houvenaegel', 'Coramy.Houvenaegel')]</items>
<orientation>vertical</orientation>
<required type="int">1</required>
<title>Socit</title>
</values>
<tales>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="unknown_selection">You selected an item that was not in the list.</message>
</messages>
</field>
</fields>
</group>
<group>
<title>hidden</title>
<fields>
</fields>
</group>
</groups>
</form>
\ No newline at end of file
## Script (Python) "SalesOrder_reportByResource"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=source_section
##title=
##
request = context.REQUEST
cr = '\r'
tab = '\t'
report = 'Produit' + tab + 'Quantite' + tab + 'Prix total' + cr
source_section_item_list = source_section.split('.')
source_section_object = context.portal_categories.group
for source_item in source_section_item_list :
source_section_object = source_section_object[source_item]
report_list = context.SalesOrder_zReportByResource(source_section_uid=source_section_object.getUid())
for report_item in report_list :
report += report_item.resource_id + tab
report += str(report_item.quantity).replace('.',',') + tab
report += str(report_item.total_price).replace('.',',') + cr
request.RESPONSE.setHeader('Content-Type','application/text')
return report
<?xml version="1.0" encoding="iso-8859-1"?>
<form>
<title>Exporter</title>
<name>SalesOrder_reportByResourceForm</name>
<action>SalesOrder_reportByResource</action>
<enctype></enctype>
<method>POST</method>
<pt>form_view_dialog</pt>
<groups>
<group>
<title>Default</title>
<fields>
<field><id>my_source_section</id> <type>RadioField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default></default>
<description></description>
<external_validator></external_validator>
<first_item type="int">1</first_item>
<hidden type="int">0</hidden>
<items type="list">[('Coramy', 'Coramy'), ('BLS', 'Coramy.BLS'), ('Houvenaegel', 'Coramy.Houvenaegel')]</items>
<orientation>vertical</orientation>
<required type="int">1</required>
<title>Socit</title>
</values>
<tales>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="unknown_selection">You selected an item that was not in the list.</message>
</messages>
</field>
</fields>
</group>
<group>
<title>hidden</title>
<fields>
</fields>
</group>
</groups>
</form>
\ No newline at end of file
<?xml version="1.0" encoding="iso-8859-1"?>
<form>
<title>Rechercher</title>
<name>SalesOrder_searchByClientGroup</name>
<action>Base_searchHandler</action>
<enctype></enctype>
<method>POST</method>
<pt>form_view_dialog</pt>
<groups>
<group>
<title>left</title>
<fields>
<field><id>my_group_list</id> <type>MultiListField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default type="list">[]</default>
<description></description>
<external_validator></external_validator>
<extra></extra>
<hidden type="int">0</hidden>
<items type="list">[]</items>
<required type="int">0</required>
<size type="int">15</size>
<title>Organigramme</title>
</values>
<tales>
<items>here/portal_categories/group/getFormItemList</items>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="unknown_selection">You selected an item that was not in the list.</message>
</messages>
</field>
<field><id>my_reset</id> <type>CheckBoxField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default type="int">1</default>
<description></description>
<external_validator></external_validator>
<extra></extra>
<hidden type="int">0</hidden>
<title>Recherche globale</title>
</values>
<tales>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
</messages>
</field>
</fields>
</group>
<group>
<title>right</title>
<fields>
<field><id>my_state_list</id> <type>MultiListField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default type="list">[]</default>
<description></description>
<external_validator></external_validator>
<extra></extra>
<hidden type="int">0</hidden>
<items type="list">[('draft', 'draft'), ('planned', 'planned'), ('ordered', 'ordered'), ('confirmed', 'confirmed'), ('delivered', 'delivered')]</items>
<required type="int">0</required>
<size type="int">5</size>
<title>Etats</title>
</values>
<tales>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="unknown_selection">You selected an item that was not in the list.</message>
</messages>
</field>
<field><id>my_list_method_id</id> <type>StringField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default>SalesOrder_zSearchByClientGroup</default>
<description></description>
<display_maxwidth></display_maxwidth>
<display_width type="int">20</display_width>
<external_validator></external_validator>
<extra></extra>
<hidden type="int">1</hidden>
<max_length></max_length>
<required type="int">0</required>
<title>x</title>
<truncate type="int">0</truncate>
</values>
<tales>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="too_long">Too much input was given.</message>
</messages>
</field>
<field><id>my_list_form_id</id> <type>StringField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default></default>
<description></description>
<display_maxwidth></display_maxwidth>
<display_width type="int">20</display_width>
<external_validator></external_validator>
<extra></extra>
<hidden type="int">1</hidden>
<max_length></max_length>
<required type="int">0</required>
<title></title>
<truncate type="int">0</truncate>
</values>
<tales>
<default>python:here.REQUEST.form_id</default>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="too_long">Too much input was given.</message>
</messages>
</field>
</fields>
</group>
</groups>
</form>
\ No newline at end of file
<dtml-comment>
title:
connection_id:MySQL
max_rows:100000
max_cache:100
cache_time:0
class_name:ZSQLBrain
class_file:zsqlbrain.py
</dtml-comment>
<params>source_section_uid</params>
SELECT group_client.title AS client, sum(movement.quantity) AS quantity, sum(movement.total_price) AS total_price
FROM catalog AS sale_order, catalog AS order_line, category AS category_sc, movement
LEFT JOIN category AS category_group ON ( category_group.uid=sale_order.uid
AND category_group.base_category_uid = <dtml-var "portal_categories.group.uid">
AND category_group.category_strict_membership = 1 )
LEFT JOIN catalog AS group_client ON ( group_client.uid = category_group.category_uid )
WHERE sale_order.portal_type = "Sales Order"
AND ( order_line.portal_type = "Sales Order Line"
OR order_line.portal_type = "Delivery Cell" )
AND order_line.uid = movement.uid
AND movement.delivery_uid = sale_order.uid
AND movement.has_cell_content = 0
AND (sale_order.simulation_state = "planned"
OR sale_order.simulation_state = "ordered"
OR sale_order.simulation_state = "draft"
OR sale_order.simulation_state = "confirmed")
AND category_sc.uid=sale_order.uid
AND category_sc.base_category_uid = <dtml-var "portal_categories.source_section.uid">
AND category_sc.category_uid = <dtml-var source_section_uid>
AND category_sc.category_strict_membership = 1
GROUP BY group_client.title
\ No newline at end of file
<dtml-comment>
title:
connection_id:MySQL
max_rows:100000
max_cache:100
cache_time:0
class_name:ZSQLBrain
class_file:zsqlbrain.py
</dtml-comment>
<params>source_section_uid</params>
SELECT resource.id AS resource_id, sum(movement.target_quantity) AS quantity, sum(movement.total_price) AS total_price
FROM catalog AS sale_order, catalog AS order_line, category AS category_sc, movement, catalog AS resource
WHERE sale_order.portal_type = "Sales Order"
AND ( order_line.portal_type = "Sales Order Line"
OR order_line.portal_type = "Delivery Cell" )
AND order_line.uid = movement.uid
AND movement.delivery_uid = sale_order.uid
AND movement.has_cell_content = 0
AND resource.uid = movement.resource_uid
AND (sale_order.simulation_state = "planned"
OR sale_order.simulation_state = "ordered"
OR sale_order.simulation_state = "draft"
OR sale_order.simulation_state = "confirmed")
AND category_sc.uid=sale_order.uid
AND category_sc.base_category_uid = <dtml-var "portal_categories.source_section.uid">
AND category_sc.category_uid = <dtml-var source_section_uid>
AND category_sc.category_strict_membership = 1
GROUP BY resource.id
\ No newline at end of file
## Script (Python) "SalesPackingList_buildRemiseTransporteurDict"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=
##title=
##
delivery_list = context.object_action_list(selection_name='sales_packing_list_selection')
# we sort the deliveries by source_section, transporteur, destination
RTDict = {}
for delivery in delivery_list :
source_section = delivery.getSourceSectionTitle()
if not source_section in RTDict.keys() :
RTDict[source_section] = {}
transporteur = delivery.getDeliveryMode()
if not transporteur in RTDict[source_section].keys() :
RTDict[source_section][transporteur] = {}
destination = delivery.getDestination()
if not destination in RTDict[source_section][transporteur].keys() :
RTDict[source_section][transporteur][destination] = []
RTDict[source_section][transporteur][destination].append(delivery)
return RTDict
## Script (Python) "SalesPackingList_oneContainerAutoPacking"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=container_type='', delivery_mode='', gross_weight='', user_name='',batch_mode=0
##title=
##
try:
request = context.REQUEST
# verify the delivery_mode in the Sales Packing List
if context.getDeliveryMode() != delivery_mode:
raise None
# verify the packing doesn't content any container
container_list = context.contentValues(filter={'portal_type':'Container'})
if len(container_list)>0:
raise None
delivery_line_list = context.contentValues(filter={'portal_type':'Sales Packing List Line'})
# creation of the container
# inspired from Container_fastInput
#Container_zGetCellList
container_number = 1
new_container_id = 'c'+str(container_number)
# we use container_type to know which are the resource (and variation) of the container
container_type_item_list = container_type.split('/')
container_resource_url = '/'.join(container_type_item_list[0:2])
container_resource_variation = 'variante/'+container_type
"""
context.portal_types.constructContent(type_name = 'Container',
container = delivery,
int_index = container_number,
serial_number = "%06d%04d" % (int(delivery.getId()),container_number),
resource = container_resource_url,
variation_base_category_list = ['variante'],
variation_category_list = [container_resource_variation],
gross_weight = gross_weight,
id = new_container_id,
)
container = delivery[new_container_id]
"""
# construct the container lines
"""
for delivery_line in delivery_line_list:
new_container_line_id = str(container.generateNewId())
# construct new content (container_line)
context.portal_types.constructContent(type_name = 'Container Line',
container = container,
id = new_container_line_id,
resource = delivery_line.getRelativeUrl(),
variation_base_category_list = delivery_line.getVariationBaseCategoryList(),
variation_category_list = delivery_line.getVariationCategoryList
)
container_line = container[new_container_line_id]
# set target_quantities in container_lines
container_cell_list = container_line.contentValues()
delivery_cell_list = delivery_line.contentValues()
for container_cell in container_cell_list:
quantity_updated = 0
for delivery_cell in delivery_cell_list:
if container_cell.test(context.asContext(categories=deliveryCell.getVariationCategoryList()) :
container_cell.setTargetQuantity(deliveryCell.getQuantity())
container_cell.flushActivity(invoke=1)
quantity_updated = 1
break
# update target_quantities on delivery_lines or cells
container.edit()
"""
# change the workflow
#context.Item_doWorkflowTransition(workflow_action='user_set_ready', workflow_id='delivery_workflow')
"""
# print container label
container.Container_printLabel(user_name=user_name)
"""
# print
# XXX this does not print anything, it's just a page template
#context.sales_packing_list_print()
except:
message = 'Livraison vente identifiant %s' % context.getId()
# and this is the end ....
if batch_mode:
context.Coramy_sendMailToUser(user_name=user_name,mSubj="Autocolisage échoué",mMsg=message)
else:
redirect_url = '%s?%s' % ( context.absolute_url(), 'portal_status_message=Autocolisage+échoué.')
return request[ 'RESPONSE' ].redirect( redirect_url )
else:
message = 'Livraison vente identifiant %s' % context.getId()
# and this is the end ....
if batch_mode:
context.Coramy_sendMailToUser(user_name=user_name,mSubj="Autocolisage réussi",mMsg=message)
else:
redirect_url = '%s?%s' % ( context.absolute_url(), 'portal_status_message=Autocolisage+réussi.')
return request[ 'RESPONSE' ].redirect( redirect_url )
<?xml version="1.0" encoding="iso-8859-1"?>
<form>
<title>Auto-coliser</title>
<name>SalesPackingList_oneContainerAutoPackingForm</name>
<action>SalesPackingList_oneContainerAutoPackingSelectScript</action>
<enctype></enctype>
<method>POST</method>
<pt>form_view_dialog</pt>
<groups>
<group>
<title>Default</title>
<fields>
<field><id>my_delivery_mode</id> <type>ListField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default></default>
<description></description>
<editable_expression></editable_expression>
<editable_permission></editable_permission>
<editable_role></editable_role>
<external_validator></external_validator>
<extra></extra>
<first_item type="int">0</first_item>
<hidden type="int">0</hidden>
<items type="list">[]</items>
<not_viewable type="int">0</not_viewable>
<read_only type="int">0</read_only>
<required type="int">0</required>
<size type="int">1</size>
<title>Mode de livraison</title>
<unicode type="int">0</unicode>
<viewable_expression></viewable_expression>
<viewable_permission></viewable_permission>
<viewable_role></viewable_role>
<whitespace_preserve type="int">0</whitespace_preserve>
</values>
<tales>
<default>python:here.portal_categories.delivery_mode.getFormItemList()[1][1]</default>
<items>here/portal_categories/delivery_mode/getFormItemList</items>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="unknown_selection">You selected an item that was not in the list.</message>
</messages>
</field>
<field><id>my_container_type</id> <type>ListField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default></default>
<description></description>
<external_validator></external_validator>
<extra></extra>
<first_item type="int">0</first_item>
<hidden type="int">0</hidden>
<items type="list">[('carton A', 'composant/CAame/A'), ('carton B', 'composant/CAame/B'), ('carton C', 'composant/CAame/C'), ('carton D1', 'composant/CAame/D1'), ('carton D2', 'composant/CAame/D2'), ('carton D3', 'composant/CAame/D3')]</items>
<required type="int">0</required>
<size type="int">1</size>
<title>Type de colis</title>
</values>
<tales>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="unknown_selection">You selected an item that was not in the list.</message>
</messages>
</field>
<field><id>my_gross_weight</id> <type>FloatField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default></default>
<description></description>
<display_maxwidth></display_maxwidth>
<display_width type="int">10</display_width>
<external_validator></external_validator>
<extra></extra>
<hidden type="int">0</hidden>
<required type="int">1</required>
<title>Poids brut (kg)</title>
</values>
<tales>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="not_float">You did not enter a floating point number.</message>
</messages>
</field>
<field><id>my_method_action</id> <type>StringField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default></default>
<description></description>
<display_maxwidth></display_maxwidth>
<display_width type="int">20</display_width>
<external_validator></external_validator>
<extra></extra>
<hidden type="int">1</hidden>
<max_length></max_length>
<required type="int">0</required>
<title>x</title>
<truncate type="int">0</truncate>
</values>
<tales>
<default>python:here.REQUEST.method_action</default>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="too_long">Too much input was given.</message>
</messages>
</field>
</fields>
</group>
<group>
<title>hidden</title>
<fields>
</fields>
</group>
</groups>
</form>
\ No newline at end of file
## Script (Python) "SalesPackingList_oneContainerAutoPackingList"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=container_type='', delivery_mode='', gross_weight=''
##title=
##
# auto packing a list of container
request = context.REQUEST
object_list = context.object_action_list(selection_name='sales_packing_list_selection')
user_name = context.portal_membership.getAuthenticatedMember().getUserName()
for invoice in object_list:
invoice.activate(activity="SQLQueue").SalesPackingList_oneContainerAutoPacking(container_type=container_type, delivery_mode=delivery_mode, gross_weight=gross_weight, user_name=user_name,batch_mode=1)
redirect_url = '%s?%s' % ( context.absolute_url(), 'portal_status_message=Autocolisage+dmarr.')
return request[ 'RESPONSE' ].redirect( redirect_url )
## Script (Python) "SalesPackingList_oneContainerAutoPackingSelectScript"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=method_action='', container_type='', delivery_mode='', gross_weight=''
##title=
##
# get the script
request = context.REQUEST
if method_action == 'SalesPackingList_oneContainerAutoPackingList':
return context.SalesPackingList_oneContainerAutoPackingList(container_type=container_type, delivery_mode=delivery_mode, gross_weight=gross_weight)
elif method_action == 'SalesPackingList_oneContainerAutoPacking':
return context.SalesPackingList_oneContainerAutoPacking(container_type=container_type, delivery_mode=delivery_mode, gross_weight=gross_weight)
else:
redirect_url = '%s?%s' % ( context.absolute_url()
, 'portal_status_message=Erreur:+script++lancer+inconnu.'
)
return request.RESPONSE.redirect( redirect_url )
<?xml version="1.0" encoding="iso-8859-1"?>
<form>
<title>Rechercher</title>
<name>SalesOrder_searchByClientGroup</name>
<action>Base_searchHandler</action>
<enctype></enctype>
<method>POST</method>
<pt>form_view_dialog</pt>
<groups>
<group>
<title>left</title>
<fields>
<field><id>my_group_list</id> <type>MultiListField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default type="list">[]</default>
<description></description>
<external_validator></external_validator>
<extra></extra>
<hidden type="int">0</hidden>
<items type="list">[]</items>
<required type="int">0</required>
<size type="int">15</size>
<title>Organigramme</title>
</values>
<tales>
<items>here/portal_categories/group/getFormItemList</items>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="unknown_selection">You selected an item that was not in the list.</message>
</messages>
</field>
<field><id>my_reset</id> <type>CheckBoxField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default type="int">1</default>
<description></description>
<external_validator></external_validator>
<extra></extra>
<hidden type="int">0</hidden>
<title>Recherche globale</title>
</values>
<tales>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
</messages>
</field>
</fields>
</group>
<group>
<title>right</title>
<fields>
<field><id>my_state_list</id> <type>MultiListField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default type="list">[]</default>
<description></description>
<external_validator></external_validator>
<extra></extra>
<hidden type="int">0</hidden>
<items type="list">[('draft', 'draft'), ('planned', 'planned'), ('ordered', 'ordered'), ('confirmed', 'confirmed'), ('getting_ready', 'getting_ready'), ('ready', 'ready'), ('started', 'started'), ('delivered', 'delivered')]</items>
<required type="int">0</required>
<size type="int">10</size>
<title>Etats</title>
</values>
<tales>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="unknown_selection">You selected an item that was not in the list.</message>
</messages>
</field>
<field><id>my_list_method_id</id> <type>StringField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default>SalesPackingList_zSearchByClientGroup</default>
<description></description>
<display_maxwidth></display_maxwidth>
<display_width type="int">20</display_width>
<external_validator></external_validator>
<extra></extra>
<hidden type="int">1</hidden>
<max_length></max_length>
<required type="int">0</required>
<title>x</title>
<truncate type="int">0</truncate>
</values>
<tales>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="too_long">Too much input was given.</message>
</messages>
</field>
<field><id>my_list_form_id</id> <type>StringField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default></default>
<description></description>
<display_maxwidth></display_maxwidth>
<display_width type="int">20</display_width>
<external_validator></external_validator>
<extra></extra>
<hidden type="int">1</hidden>
<max_length></max_length>
<required type="int">0</required>
<title></title>
<truncate type="int">0</truncate>
</values>
<tales>
<default>python:here.REQUEST.form_id</default>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="too_long">Too much input was given.</message>
</messages>
</field>
</fields>
</group>
</groups>
</form>
\ No newline at end of file
<?xml version="1.0" encoding="iso-8859-1"?>
<form>
<title>Commande chantillons</title>
<name>order_view</name>
<action>base_edit</action>
<enctype>multipart/form-data</enctype>
<method>POST</method>
<pt>form_view</pt>
<groups>
<group>
<title>left</title>
<fields>
<field><id>my_id</id> <type>StringField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default></default>
<description></description>
<display_maxwidth></display_maxwidth>
<display_width type="int">10</display_width>
<external_validator></external_validator>
<extra></extra>
<hidden type="int">0</hidden>
<max_length></max_length>
<required type="int">1</required>
<title>Id</title>
<truncate type="int">0</truncate>
</values>
<tales>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="too_long">Too much input was given.</message>
</messages>
</field>
<field><id>my_reference</id> <type>StringField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default></default>
<description></description>
<display_maxwidth></display_maxwidth>
<display_width type="int">20</display_width>
<external_validator></external_validator>
<extra></extra>
<hidden type="int">0</hidden>
<max_length></max_length>
<required type="int">0</required>
<title>Numro de facture</title>
<truncate type="int">0</truncate>
</values>
<tales>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="too_long">Too much input was given.</message>
</messages>
</field>
<field><id>my_destination_title</id> <type>RelationStringField</type>
<values>
<alternate_name></alternate_name>
<base_category>destination</base_category>
<catalog_index>Title</catalog_index>
<css_class></css_class>
<default></default>
<default_module>organisation</default_module>
<description></description>
<display_maxwidth></display_maxwidth>
<display_width type="int">20</display_width>
<external_validator></external_validator>
<extra></extra>
<hidden type="int">0</hidden>
<jump_method>base_jump_relation</jump_method>
<max_length></max_length>
<portal_type type="list">[('Organisation', 'Organisation')]</portal_type>
<required type="int">0</required>
<title>Client</title>
<truncate type="int">0</truncate>
<update_method>base_update_relation</update_method>
</values>
<tales>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="too_long">Too much input was given.</message>
</messages>
</field>
<field><id>my_buyer_title</id> <type>RelationStringField</type>
<values>
<alternate_name></alternate_name>
<base_category>contact</base_category>
<catalog_index>Title</catalog_index>
<css_class></css_class>
<default></default>
<default_module>person</default_module>
<description></description>
<display_maxwidth></display_maxwidth>
<display_width type="int">20</display_width>
<external_validator></external_validator>
<extra></extra>
<hidden type="int">0</hidden>
<jump_method>base_jump_relation</jump_method>
<max_length></max_length>
<portal_type type="list">[('Person', 'Person')]</portal_type>
<required type="int">0</required>
<title>Acheteur</title>
<truncate type="int">0</truncate>
<update_method>base_update_relation</update_method>
</values>
<tales>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="too_long">Too much input was given.</message>
</messages>
</field>
<field><id>my_description</id> <type>TextAreaField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default></default>
<description></description>
<external_validator></external_validator>
<extra></extra>
<height type="int">1</height>
<hidden type="int">0</hidden>
<max_length></max_length>
<max_linelength></max_linelength>
<max_lines></max_lines>
<required type="int">0</required>
<title>Rayon</title>
<width type="int">30</width>
</values>
<tales>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="too_many_lines">You entered too many lines.</message>
<message name="line_too_long">A line was too long.</message>
<message name="too_long">You entered too many characters.</message>
</messages>
</field>
<field><id>my_value_added_tax_ratio</id> <type>FloatField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default></default>
<description></description>
<display_maxwidth></display_maxwidth>
<display_width type="int">20</display_width>
<external_validator></external_validator>
<extra></extra>
<hidden type="int">0</hidden>
<required type="int">1</required>
<title>Taux de TVA</title>
</values>
<tales>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="not_float">You did not enter a floating point number.</message>
</messages>
</field>
<field><id>my_value_added_tax_recoverable</id> <type>ListField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default></default>
<description></description>
<external_validator></external_validator>
<extra></extra>
<first_item type="int">0</first_item>
<hidden type="int">0</hidden>
<items type="list">[('Non', '0'), ('Oui', '1')]</items>
<required type="int">0</required>
<size type="int">1</size>
<title>Soumis la TVA</title>
</values>
<tales>
<default>python:str(here.getValueAddedTaxRecoverable())</default>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="unknown_selection">You selected an item that was not in the list.</message>
</messages>
</field>
</fields>
</group>
<group>
<title>right</title>
<fields>
<field><id>my_date_rdv</id> <type>DateTimeField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<date_only type="int">1</date_only>
<date_separator>/</date_separator>
<default_now type="int">0</default_now>
<description></description>
<external_validator></external_validator>
<hidden type="int">0</hidden>
<input_order>dmy</input_order>
<input_style>text</input_style>
<required type="int">0</required>
<time_separator>:</time_separator>
<title>Date rendez-vous</title>
</values>
<tales>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="not_datetime">You did not enter a valid date and time.</message>
<message name="datetime_out_of_range">The date and time you entered were out of range.</message>
</messages>
</field>
<field><id>my_collection</id> <type>ListField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default></default>
<description></description>
<external_validator></external_validator>
<extra></extra>
<first_item type="int">0</first_item>
<hidden type="int">0</hidden>
<items type="list">[]</items>
<required type="int">0</required>
<size type="int">1</size>
<title>Collection</title>
</values>
<tales>
<items>here/portal_categories/collection/getFormItemList</items>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="unknown_selection">You selected an item that was not in the list.</message>
</messages>
</field>
<field><id>my_start_date</id> <type>DateTimeField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<date_only type="int">1</date_only>
<date_separator>/</date_separator>
<default_now type="int">0</default_now>
<description></description>
<external_validator></external_validator>
<hidden type="int">0</hidden>
<input_order>dmy</input_order>
<input_style>text</input_style>
<required type="int">0</required>
<time_separator>:</time_separator>
<title>Livrer partir du</title>
</values>
<tales>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="not_datetime">You did not enter a valid date and time.</message>
<message name="datetime_out_of_range">The date and time you entered were out of range.</message>
</messages>
</field>
<field><id>my_stop_date</id> <type>DateTimeField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<date_only type="int">1</date_only>
<date_separator>/</date_separator>
<default_now type="int">0</default_now>
<description></description>
<external_validator></external_validator>
<hidden type="int">0</hidden>
<input_order>dmy</input_order>
<input_style>text</input_style>
<required type="int">0</required>
<time_separator>:</time_separator>
<title>Livrer avant le</title>
</values>
<tales>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="not_datetime">You did not enter a valid date and time.</message>
<message name="datetime_out_of_range">The date and time you entered were out of range.</message>
</messages>
</field>
<field><id>order_state</id> <type>StringField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default></default>
<description></description>
<display_maxwidth></display_maxwidth>
<display_width type="int">20</display_width>
<external_validator></external_validator>
<extra></extra>
<hidden type="int">0</hidden>
<max_length></max_length>
<required type="int">0</required>
<title>Etat</title>
<truncate type="int">0</truncate>
</values>
<tales>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="too_long">Too much input was given.</message>
</messages>
</field>
</fields>
</group>
<group>
<title>center</title>
<fields>
<field><id>my_commentaires</id> <type>TextAreaField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default></default>
<description></description>
<external_validator></external_validator>
<extra></extra>
<height type="int">3</height>
<hidden type="int">0</hidden>
<max_length></max_length>
<max_linelength></max_linelength>
<max_lines></max_lines>
<required type="int">0</required>
<title>Commentaires</title>
<width type="int">80</width>
</values>
<tales>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="too_many_lines">You entered too many lines.</message>
<message name="line_too_long">A line was too long.</message>
<message name="too_long">You entered too many characters.</message>
</messages>
</field>
</fields>
</group>
<group>
<title>bottom</title>
<fields>
<field><id>listbox</id> <type>ListBox</type>
<values>
<all_columns type="list">[('id', 'Ligne'), ('Description', 'Description'), ('getResourceRelativeUrl', 'Composant'), ('quantity', 'Quantit\xe9'), ('quantity_unit', 'Unit\xe9')]</all_columns>
<all_editable_columns type="list">[('quantity', 'Quantit\xe9'), ('quantity_unit', 'Unit\xe9')]</all_editable_columns>
<alternate_name></alternate_name>
<columns type="list">[('id', 'Ligne'), ('Description', 'Description'), ('getResourceRelativeUrl', 'Composant'), ('quantity', 'Quantit\xe9'), ('quantity_unit', 'Unit\xe9')]</columns>
<css_class></css_class>
<default></default>
<default_params type="list">[]</default_params>
<description></description>
<domain_root_list type="list">[]</domain_root_list>
<domain_tree type="int">0</domain_tree>
<editable_columns type="list">[('quantity', 'Quantit\xe9'), ('quantity_unit', 'Unit\xe9')]</editable_columns>
<external_validator></external_validator>
<global_attributes type="list">[]</global_attributes>
<hidden type="int">0</hidden>
<lines type="int">10</lines>
<list_action>folder_contents</list_action>
<list_method type="method">searchFolder</list_method>
<meta_types type="list">[]</meta_types>
<portal_types type="list">[('Invoice Line', 'Invoice Line')]</portal_types>
<report_root_list type="list">[]</report_root_list>
<report_tree type="int">0</report_tree>
<search type="int">0</search>
<search_columns type="list">[]</search_columns>
<select type="int">0</select>
<selection_name>order_line_selection</selection_name>
<sort type="list">[('id', 'id')]</sort>
<stat_method></stat_method>
<title>Lignes de commande</title>
</values>
<tales>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
</messages>
</field>
</fields>
</group>
<group>
<title>hidden</title>
<fields>
<field><id>listbox_quantity</id> <type>FloatField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default></default>
<description></description>
<display_maxwidth></display_maxwidth>
<display_width type="int">20</display_width>
<external_validator></external_validator>
<extra></extra>
<hidden type="int">0</hidden>
<required type="int">0</required>
<title>listbox_quantity</title>
</values>
<tales>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="not_float">You did not enter a floating point number.</message>
</messages>
</field>
<field><id>listbox_quantity_unit</id> <type>ListField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default></default>
<description></description>
<external_validator></external_validator>
<extra></extra>
<first_item type="int">0</first_item>
<hidden type="int">0</hidden>
<items type="list">[]</items>
<required type="int">0</required>
<size type="int">1</size>
<title>Unit</title>
</values>
<tales>
<items>here/portal_categories/quantity_unit/getFormItemList</items>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="unknown_selection">You selected an item that was not in the list.</message>
</messages>
</field>
</fields>
</group>
</groups>
</form>
\ No newline at end of file
<?xml version="1.0" encoding="iso-8859-1" ?>
<template filename="default.pdf"
pagesize="A4"
landscape="0"
showboundary="0"
leftmargin="1cm"
rightmargin="1cm"
topmargin="1cm"
bottommargin="1cm"
allowsplitting="1"
tal:define="packing_list python:here.getCausalityValueList(portal_type=['Sale Packing List','Sales Packing List'])[0];
invoice_id python:here.getId();
resource_title python:here.getResourceTitle() or 'Euros';
resource_id python:here.getResourceId() or 'EUR';
income python: here.income;
vat python: here.vat;
payable python: here.payable;">
<tal:block
tal:define="destination python: packing_list.getDestinationValue();
destination_administration python: packing_list.getDestinationAdministrationValue() or packing_list.getDestinationSectionValue();
start_date python:packing_list.getStartDate();
packing_list_id python:packing_list.getId();
order python:packing_list.getCausalityValueList(portal_type=['Sale Order','Sales Order'])[0];">
<stylesheet>
<paragraphstyle name="Normal" fontname="Helvetica" fontsize="12"
align="LEFT" firstLineIndent="0"/>
<paragraphstyle name="Bullet" fontname="Helvetica" fontsize="12"
bulletFontName="Symbol" bulletFontSize="14"
leftIndent="20" firstLineIndent="0"
parent="Normal"/>
<paragraphstyle name="Heading1" parent="Normal"
fontname="Helvetica-Bold" fontsize="16"/>
<paragraphstyle name="Heading2" parent="Normal"
fontname="Helvetica-Bold" fontsize="15"/>
<paragraphstyle name="Heading3" parent="Normal"
fontname="Helvetica-Bold" fontsize="14"/>
<paragraphstyle name="Heading4" parent="Normal"
fontname="Helvetica-Bold" fontsize="13"/>
<paragraphstyle name="Heading5" parent="Normal"
fontname="Helvetica-Bold" fontsize="12"/>
<paragraphstyle name="Heading6" parent="Normal"
fontname="Helvetica-Bold" fontsize="11"/>
<paragraphstyle name="Heading7" parent="Normal"
fontname="Helvetica-Bold" fontsize="10"/>
<paragraphstyle name="Small" parent="Normal" fontname="Helvetica-Bold"
fontsize="7"/>
<paragraphstyle name="Cell" parent="Normal" fontname="Helvetica-Bold"
fontsize="12"
alignment="center" />
<paragraphstyle name="CellHeading" parent="Normal"
fontname="Helvetica-Bold" fontsize="13"
alignment="center"/>
<paragraphstyle name="Example" fontname="Courier-Oblique" fontsize="10"
parent="Normal"/>
<paragraphstyle name="InvoiceItem" fontname="Courier-Oblique"
fontsize="10"
parent="Normal"/>
<tablestyle name="StandardTable">
<stylecmd expr="('LEFTPADDING', (0,0), (-1,-1), 5)"/>
<stylecmd expr="('RIGHTPADDING', (0,0), (-1,-1), 5)"/>
<stylecmd expr="('TOPPADDING', (0,0), (-1,-1), 3)"/>
<stylecmd expr="('BOTTOMPADDING', (0,0), (-1,-1), 7)"/>
<stylecmd expr="('ALIGN', (0,0), (-1,-1), 'RIGHT')"/>
<stylecmd expr="('GRID', (0,0), (-1,-1), 0.5, colors.black)"/>
<stylecmd expr="('BOX', (0,0), (-1,-1), 1, colors.black)"/>
<stylecmd expr="('FONT', (0,0), (-1,-1), 'Helvetica', 10)"/>
</tablestyle>
<tablestyle name="HeadLine">
<stylecmd expr="('LEFTPADDING', (0,0), (-1,-1), 5)"/>
<stylecmd expr="('RIGHTPADDING', (0,0), (-1,-1), 5)"/>
<stylecmd expr="('TOPPADDING', (0,0), (-1,-1), 1)"/>
<stylecmd expr="('BOTTOMPADDING', (0,0), (-1,-1), 1)"/>
<stylecmd expr="('ALIGN', (0,0), (-1,-1), 'LEFT')"/>
<stylecmd expr="('GRID', (0,0), (-1,-1), 0, colors.white)"/>
<stylecmd expr="('BOX', (0,0), (-1,-1), 0, colors.white)"/>
<stylecmd expr="('FONT', (0,0), (-1,-1), 'Helvetica', 8)"/>
<stylecmd expr="('BACKGROUND', (0,0), (-1,-1), colors.white)"/>
<stylecmd expr="('TEXTCOLOR', (0,0), (-1,-1), colors.black)"/>
<stylecmd expr="('HALIGN', 'LEFT')"/>
</tablestyle>
<tablestyle name="HeadLine2">
<stylecmd expr="('LEFTPADDING', (0,0), (-1,-1), 5)"/>
<stylecmd expr="('RIGHTPADDING', (0,0), (-1,-1), 5)"/>
<stylecmd expr="('TOPPADDING', (0,0), (-1,-1), 1)"/>
<stylecmd expr="('BOTTOMPADDING', (0,0), (-1,-1), 1)"/>
<stylecmd expr="('ALIGN', (0,0), (-1,-1), 'LEFT')"/>
<stylecmd expr="('GRID', (0,0), (-1,-1), 0, colors.white)"/>
<stylecmd expr="('BOX', (0,0), (-1,-1), 0, colors.white)"/>
<stylecmd expr="('FONT', (0,0), (-1,-1), 'Helvetica', 6)"/>
<stylecmd expr="('BACKGROUND', (0,0), (-1,-1), colors.white)"/>
<stylecmd expr="('TEXTCOLOR', (0,0), (-1,-1), colors.black)"/>
<stylecmd expr="('HALIGN', 'LEFT')"/>
</tablestyle>
<tablestyle name="TotalLine">
<stylecmd expr="('LEFTPADDING', (0,0), (-1,-1), 5)"/>
<stylecmd expr="('RIGHTPADDING', (0,0), (-1,-1), 5)"/>
<stylecmd expr="('TOPPADDING', (0,0), (-1,-1), 1)"/>
<stylecmd expr="('BOTTOMPADDING', (0,0), (-1,-1), 1)"/>
<stylecmd expr="('ALIGN', (0,0), (-1,-1), 'RIGHT')"/>
<stylecmd expr="('GRID', (0,0), (-1,-1), 0, colors.white)"/>
<stylecmd expr="('BOX', (0,0), (-1,-1), 0, colors.white)"/>
<stylecmd expr="('FONT', (0,0), (-1,-1), 'Helvetica-Oblique', 8)"/>
<stylecmd expr="('FONT', (-2,0), (-2,-1), 'Helvetica', 8)"/>
<stylecmd expr="('TEXTCOLOR', (0,0), (-1,-1), colors.black)"/>
<stylecmd expr="('HALIGN', 'LEFT')"/>
</tablestyle>
<tablestyle name="CellTable">
<stylecmd expr="('LEFTPADDING', (0,0), (-1,-1), 5)"/>
<stylecmd expr="('RIGHTPADDING', (0,0), (-1,-1), 5)"/>
<stylecmd expr="('TOPPADDING', (0,0), (-1,-1), 1)"/>
<stylecmd expr="('BOTTOMPADDING', (0,0), (-1,-1), 1)"/>
<stylecmd expr="('ALIGN', (0,0), (1,-1), 'LEFT')"/>
<stylecmd expr="('ALIGN', (2,0), (-4,-1), 'CENTER')"/>
<stylecmd expr="('ALIGN', (-3,0), (-1,-1), 'RIGHT')"/>
<stylecmd expr="('GRID', (2,1), (-5,-1), 0.2, colors.black)"/>
<stylecmd expr="('BOX', (2,1), (-5,-1), 0.2, colors.black)"/>
<stylecmd expr="('FONT', (0,0), (-1,0), 'Helvetica', 6)"/>
<stylecmd expr="('FONT', (0,1), (-1,-1), 'Helvetica', 8)"/>
<stylecmd expr="('HALIGN', 'LEFT')"/>
</tablestyle>
</stylesheet>
<pagetemplate id="FirstPage" nextid="Page" startframe="content">
<static>
<!-- Entete CORAMY -->
<infostring align="left" x="1.4cm" y="28cm" size="40"
font="Times-Bold" color="(0,0,0)">Coramy</infostring>
<rectangle x="1cm" y="28cm" width="0.3cm" height="0.4cm"
linewidth="0.0" stroke="(1,1,1)" fill="(0.5,0.5,0.5)"/>
<rectangle x="6.5cm" y="28cm" width="13.5cm" height="0.4cm"
linewidth="0.0" stroke="(1,1,1)" fill="(0.5,0.5,0.5)"/>
<infostring align="left" x="7cm" y="28.5cm" size="8"
font="Helvetica" color="(0,0,0)">
5 bis, rue Denis Cordonnier - F.59820 GRAVELINES - Tel. 33(0)3 28 51 91 51 - Fax 33(0)3 28 23 34 96
</infostring>
<infostring align="left" x="10cm" y="28.1cm" size="8"
font="Helvetica" color="(1,1,1)">
MAILLOTS DE BAIN - GYM - SWIMSUITS - FITNESS
</infostring>
<infostring align="left" x="6.8cm" y="27.7cm" size="6"
font="Helvetica" color="(0,0,0)">
SAS capital de 435.200 EUR - T.V.A. FR 67 611 750 274 - R.C. Dunkerque 611 750 274 - SIRET 611 750 274 00023 - CNUF 15971
</infostring>
<!-- Titre du document (Facture n) -->
<infostring align="left" x="6.8cm" y="26cm" size="16"
font="Helvetica-Bold" color="(0,0,0)" tal:content="python: 'Facture n %s' % invoice_id">
Facture n 105 915
</infostring>
<infostring align="left" x="14cm" y="26cm" size="8"
font="Helvetica" color="(0,0,0)" tal:content="python: start_date.strftime('Gravelines, le %e/%m/%y')">
Gravelines, le 9/07/03
</infostring>
<infostring align="left" x="18.5cm" y="26cm" size="8"
font="Helvetica-Bold" color="(0,0,0)">
Folio 1
</infostring>
<!-- Grand cadre de la fature -->
<line x1="1cm" x2="20.5cm" y1="25cm" y2="25cm" width="1"/>
<line x1="1cm" x2="1cm" y1="25cm" y2="4cm" width="1"/>
<line x1="20.5cm" x2="20.5cm" y1="25cm" y2="4cm" width="1"/>
<line x1="1cm" x2="20.5cm" y1="4cm" y2="4cm" width="1"/>
<!-- Entete de facture -->
<!-- Quadrillage de l'entete de facture -->
<line x1="4.2cm" x2="4.2cm" y1="25cm" y2="20.3cm" width="1"/>
<line x1="11.4cm" x2="11.4cm" y1="25cm" y2="20.3cm" width="1"/>
<line x1="18.5cm" x2="18.5cm" y1="25cm" y2="20.3cm" width="1"/>
<line x1="4.2cm" x2="18.5cm" y1="22.3cm" y2="22.3cm" width="1"/>
<line x1="1cm" x2="20.5cm" y1="20.3cm" y2="20.3cm" width="1"/>
<infostring align="left" x="1.8cm" y="24.7cm" size="6" font="Helvetica-Oblique" color="(0,0,0)">
Commande No
</infostring>
<infostring align="left" x="1.5cm" y="24.5cm" size="6" font="Helvetica-Oblique" color="(0,0,0)">
Auftrag Nr / Order No
</infostring>
<infostring align="center" x="2.5cm" y="24.2cm" size="8" font="Helvetica-Bold" color="(0,0,0)"
tal:content="python: order.getDestinationReference()">
7286007
</infostring>
<infostring align="left" x="1.7cm" y="23.8cm" size="6" font="Helvetica-Oblique" color="(0,0,0)">
Confirmation No
</infostring>
<infostring align="left" x="1.8cm" y="23.6cm" size="6" font="Helvetica-Oblique" color="(0,0,0)">
Besttigung Nr
</infostring>
<infostring align="center" x="2.5cm" y="23.3cm" size="8" font="Helvetica-Bold" color="(0,0,0)"
tal:content="python: order.getId()">
119 022
</infostring>
<infostring align="left" x="1.1cm" y="22.9cm" size="6" font="Helvetica-Oblique" color="(0,0,0)">
Livraison No / Lieferschein Nr
</infostring>
<infostring align="left" x="1.8cm" y="22.7cm" size="6" font="Helvetica-Oblique" color="(0,0,0)">
Delifery note No
</infostring>
<infostring align="center" x="2.5cm" y="22.4cm" size="8" font="Helvetica-Bold" color="(0,0,0)"
tal:content="python: packing_list_id">
108 301
</infostring>
<infostring align="left" x="1.1cm" y="21.9cm" size="6" font="Helvetica-Oblique" color="(0,0,0)">
Nombre de colis
</infostring>
<infostring align="left" x="1.3cm" y="21.7cm" size="6" font="Helvetica-Oblique" color="(0,0,0)">
Kolli anzahl
</infostring>
<infostring align="left" x="1.2cm" y="21.5cm" size="6" font="Helvetica-Oblique" color="(0,0,0)">
Nb of parcels
</infostring>
<infostring align="left" x="3.5cm" y="21.7cm" size="8" font="Helvetica-Bold" color="(0,0,0)">
32
</infostring>
<infostring align="left" x="1.1cm" y="21cm" size="6" font="Helvetica" color="(0,0,0)">
Poids brut (kg)
</infostring>
<infostring align="left" x="1.2cm" y="20.8cm" size="6" font="Helvetica" color="(0,0,0)">
Brutto-gewicht
</infostring>
<infostring align="left" x="1.3cm" y="20.6cm" size="6" font="Helvetica" color="(0,0,0)">
Gross weight
</infostring>
<infostring align="left" x="6cm" y="24.7cm" size="6" font="Helvetica-Oblique" color="(0,0,0)">
Livraison / Versand / Delivery
</infostring>
<infostring align="left" x="4.4cm" y="24.3cm" size="8" font="Helvetica-Bold" color="(0,0,0)"
tal:content="python: destination.getTitle()">
LA REDOUTE BERTHELOT
</infostring>
<tal:block tal:define="addr_list python: destination.getDefaultAddressText().split('\n')">
<tal:block tal:repeat="addr_item addr_list">
<tal:block tal:define="index repeat/addr_item/index">
<infostring align="left" x="4.4cm" size="8" font="Helvetica-Bold" color="(0,0,0)"
tal:attributes="y python: '%fcm' % (23.9 - index * 0.4)" tal:content="addr_item">
119 CHAUSSEE BERTHELOT
</infostring>
</tal:block>
</tal:block>
</tal:block>
<infostring align="left" x="11.6cm" y="24.3cm" size="8" font="Helvetica-Bold" color="(0,0,0)"
tal:content="python: destination_administration.getTitle()">
REDOUTE
</infostring>
<tal:block tal:define="addr_list python: destination_administration.getDefaultAddressText().split('\n')">
<tal:block tal:repeat="addr_item addr_list">
<tal:block tal:define="index repeat/addr_item/index">
<infostring align="left" x="11.6cm" size="8" font="Helvetica-Bold" color="(0,0,0)"
tal:attributes="y python: '%fcm' % (23.9 - index * 0.4)" tal:content="addr_item">
119 CHAUSSEE BERTHELOT
</infostring>
</tal:block>
</tal:block>
</tal:block>
<infostring align="left" x="4.5cm" y="22cm" size="6" font="Helvetica-Oblique" color="(0,0,0)">
Commercial
</infostring>
<infostring align="left" x="4.4cm" y="21.5cm" size="6" font="Helvetica-Oblique" color="(0,0,0)">
Paiement
</infostring>
<infostring align="left" x="4.6cm" y="21.3cm" size="6" font="Helvetica-Oblique" color="(0,0,0)">
Zahlung
</infostring>
<infostring align="left" x="4.5cm" y="21.1cm" size="6" font="Helvetica-Oblique" color="(0,0,0)">
Payment
</infostring>
<infostring align="left" x="4.3cm" y="20.7cm" size="6" font="Helvetica-Oblique" color="(0,0,0)">
Device / Currency / Wahrung
</infostring>
<infostring align="left" x="5.8cm" y="21.4cm" size="8" font="Helvetica-Bold" color="(0,0,0)">
Cheque
</infostring>
<infostring align="left" x="5.8cm" y="21.1cm" size="8" font="Helvetica-Bold" color="(0,0,0)">
20 jours Net
</infostring>
<infostring align="left" x="8.5cm" y="20.6cm" size="8" font="Helvetica-Bold" color="(0,0,0)"
tal:content="python: resource_title">
Euros
</infostring>
<infostring align="left" x="10.2cm" y="20.6cm" size="8" font="Helvetica-Bold" color="(0,0,0)"
tal:content="python: resource_id">
EUR
</infostring>
<infostring align="left" x="11.6cm" y="22cm" size="6" font="Helvetica-Oblique" color="(0,0,0)">
Code comptable
</infostring>
<infostring align="left" x="11.6cm" y="21.4cm" size="6" font="Helvetica-Oblique" color="(0,0,0)">
No TVA intracom.
</infostring>
<infostring align="left" x="11.6cm" y="20.9cm" size="6" font="Helvetica-Oblique" color="(0,0,0)">
Conditions d'escompte / Diskont / Discount.
</infostring>
<infostring align="left" x="14cm" y="22cm" size="8" font="Helvetica-Bold" color="(0,0,0)">
41REDOU
</infostring>
<infostring align="left" x="11.6cm" y="20.6cm" size="8" font="Helvetica-Bold" color="(0,0,0)">
2,75 sous 20 jours
</infostring>
<infostring align="left" x="18.9cm" y="24.6cm" size="6" font="Helvetica-Oblique" color="(0,0,0)">
Port / Porto
</infostring>
<infostring align="left" x="19.1cm" y="24.4cm" size="6" font="Helvetica-Oblique" color="(0,0,0)">
Freight
</infostring>
<infostring align="left" x="19cm" y="24cm" size="8" font="Helvetica-Bold" color="(0,0,0)">
Franco
</infostring>
<infostring align="left" x="18.9cm" y="23.4cm" size="6" font="Helvetica-Oblique" color="(0,0,0)">
Transporteur
</infostring>
<infostring align="left" x="18.6cm" y="23.2cm" size="6" font="Helvetica-Oblique" color="(0,0,0)">
Carrier / Spediteur
</infostring>
<infostring align="left" x="18.8cm" y="22.8cm" size="8" font="Helvetica-Bold" color="(0,0,0)">
CORAMY
</infostring>
<infostring align="left" x="18.6cm" y="22cm" size="6" font="Helvetica-Oblique" color="(0,0,0)">
Transport
</infostring>
<infostring align="left" x="20cm" y="22cm" size="8" font="Helvetica-Bold" color="(0,0,0)">
3
</infostring>
<infostring align="left" x="18.6cm" y="21.4cm" size="6" font="Helvetica-Oblique" color="(0,0,0)">
Transaction
</infostring>
<infostring align="left" x="19.9cm" y="21.4cm" size="8" font="Helvetica-Bold" color="(0,0,0)">
11
</infostring>
<infostring align="left" x="18.6cm" y="20.8cm" size="6" font="Helvetica-Oblique" color="(0,0,0)">
Livraison
</infostring>
<!-- Dtail de la facture -->
<rectangle x="1cm" y="19.9cm" width="19.5cm" height="0.4cm"
linewidth="0" fill="(0.75,0.75,0.75)"/>
<line x1="1cm" x2="20.5cm" y1="19.9cm" y2="19.9cm" width="1"/>
<infostring align="left" x="2.8cm" y="20cm" size="9"
font="Helvetica-Oblique" color="(0,0,0)">
Denomination des produits
</infostring>
<infostring align="left" x="10cm" y="20cm" size="9"
font="Helvetica-Oblique" color="(0,0,0)">
Repartition par tailles
</infostring>
<infostring align="left" x="15.4cm" y="20cm" size="9"
font="Helvetica-Oblique" color="(0,0,0)">
Quantite
</infostring>
<infostring align="left" x="17.1cm" y="20cm" size="9"
font="Helvetica-Oblique" color="(0,0,0)">
P.U.H.T.
</infostring>
<infostring align="left" x="18.8cm" y="20cm" size="9"
font="Helvetica-Oblique" color="(0,0,0)">
Total H.T.
</infostring>
<!-- Pied de facture -->
<rectangle x="1cm" y="5.0cm" width="19.5cm" height="0.8cm"
linewidth="0" fill="(0.75,0.75,0.75)"/>
<line x1="1cm" x2="20.5cm" y1="5.8cm" y2="5.8cm" width="1"/>
<line x1="1cm" x2="20.5cm" y1="5.0cm" y2="5.0cm" width="1"/>
<infostring align="left" x="1.5cm" y="5.5cm" size="9"
font="Helvetica-Oblique" color="(0,0,0)">
Total H.T.
</infostring>
<infostring align="left" x="3.8cm" y="5.5cm" size="9"
font="Helvetica-Oblique" color="(0,0,0)">
Port taxable
</infostring>
<infostring align="left" x="6.2cm" y="5.5cm" size="9"
font="Helvetica-Oblique" color="(0,0,0)">
Montant taxable
</infostring>
<infostring align="left" x="9.2cm" y="5.5cm" size="9"
font="Helvetica-Oblique" color="(0,0,0)">
T.V.A.
</infostring>
<infostring align="left" x="9.3cm" y="5.1cm" size="9"
font="Helvetica" color="(0,0,0)">
19,6%%
</infostring>
<infostring align="left" x="11.2cm" y="5.5cm" size="9"
font="Helvetica-Oblique" color="(0,0,0)">
Port
</infostring>
<infostring align="left" x="10.7cm" y="5.1cm" size="9"
font="Helvetica-Oblique" color="(0,0,0)">
non taxable
</infostring>
<infostring align="left" x="13.8cm" y="5.5cm" size="9"
font="Helvetica-Oblique" color="(0,0,0)">
Net a payer
</infostring>
<infostring align="left" x="12.6cm" y="5.1cm" size="9"
font="Helvetica-Oblique" color="(0,0,0)">
Gesamtbetrag / Total amount
</infostring>
<infostring align="left" x="17.5cm" y="5.5cm" size="9"
font="Helvetica-Oblique" color="(0,0,0)">
Date d'echeance
</infostring>
<infostring align="left" x="17cm" y="5.1cm" size="9"
font="Helvetica-Oblique" color="(0,0,0)">
Falligkeitstag / Due date
</infostring>
<infostring align="center" x="2.2cm" y="4.5cm" size="9"
font="Helvetica" color="(0,0,0)"
tal:content="python: '%.2f' % income.getSourceCredit()">
14 408,46
</infostring>
<infostring align="left" x="6.5cm" y="4.5cm" size="9"
font="Helvetica" color="(0,0,0)">
14 408,46
</infostring>
<infostring align="center" x="9.7cm" y="4.5cm" size="9"
font="Helvetica" color="(0,0,0)"
tal:content="python: '%.2f' % vat.getSourceCredit()">
2 824,06
</infostring>
<infostring align="center" x="13.8cm" y="4.5cm" size="10"
font="Helvetica-Bold" color="(0,0,0)"
tal:content="python: '%.2f' % payable.getSourceDebit()">
17 232,52
</infostring>
<infostring align="center" x="16cm" y="4.5cm" size="10"
font="Helvetica-Bold" color="(0,0,0)"
tal:content="python: resource_id">
EUR
</infostring>
<infostring align="left" x="18cm" y="4.5cm" size="10"
font="Helvetica-Bold" color="(0,0,0)">
31/07/03
</infostring>
<infostring align="left" x="1.1cm" y="3.8cm" size="5" font="Helvetica" color="(0,0,0)">
En application de la loi du 31/12/1992, nous vous precisons que la presente facture devra etre reglee a la date indiquee ci-dessous. En cas de reglement comptant sous 10 jours, date de facture, l'escompte ci-dessus mentionne purra etre deduit du
</infostring>
<infostring align="left" x="1.1cm" y="3.5cm" size="5" font="Helvetica" color="(0,0,0)">
montant H.T. de la facture, auquel cas le montant de TVA deductible par vous devra etre diminue du montant de celle affrente a l'escompte. Son rglement donnera lieu au versement d'un intrt moratoire, calcule sur les sommes restant
</infostring>
<infostring align="left" x="1.1cm" y="3.2cm" size="5" font="Helvetica" color="(0,0,0)">
dues a cette date de reglement en principal, frais et taxes inclus, et au taux de l'interet legal majore de 5 points, sans que cette penalite puisse etre en toute hypothese inferieure a 1,5 fois le taux de l'interet legal.
</infostring>
<infostring align="left" x="1.6cm" y="2.7cm" size="8" font="Helvetica-Bold" color="(0,0,0)">
Nos marchandises sont grevees d'une clause de reserve de propriete, reprise dans nos conditions generales de venteindiquees au verso
</infostring>
<infostring align="left" x="4.5cm" y="2.4cm" size="8" font="Helvetica-Bold" color="(0,0,0)">
Allegemeine Verkaufsbedingungen auf ruckseite - General sales conditions overleaf
</infostring>
</static>
<frame id="content"
nextid="content"
x="1cm"
y="5.8cm"
width="19.5cm"
height="14.1cm"
leftpadding="0.1cm"
rightpadding="0.1cm"
toppadding="0.2cm"
bottompadding="0.5cm"
showBoundary="1"/>
</pagetemplate>
<pagetemplate id="Page" >
<static>
<infostring align="left" x="10cm" y= "28cm" size="10"
font="Helvetica" color="(0,0,0)">Page %(page)s</infostring>
</static>
<frame id="content"
nextid="content"
x="2cm"
y="1.5cm"
width="17cm"
height="25.5cm"
leftpadding="0.1cm"
rightpadding="0.1cm"
toppadding="0.5cm"
bottompadding="0.5cm"
showBoundary="1"/>
</pagetemplate>
</tal:block>
</template>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=ISO-8859-1">
<title tal:content="here/getTitle">Coramy</title>
<link rel=stylesheet type="text/css" href="echantillon">
</head>
<body
tal:define="client python:here.getDefaultValue('destination',portal_type=['Organisation']);
acheteur python:here.getDefaultValue('contact',portal_type=['Person']);
lignes_cde python:here.contentValues(filter={'portal_type':'Sample Order Line'});
lignes_index python:here.ordered_lines(lignes_cde=lignes_cde);
nb_echantillons python:len(lignes_cde);
col_nb python:2;
lin_nb python:2;
nb_pages python:here.echantillon_page_count(total_nb=nb_echantillons,on_page=col_nb*lin_nb)
">
<table tal:repeat="page_no python:range(nb_pages)" class="PageA4" width="660" height="955" border="0" cellpadding="0" cellspacing="0">
<tr>
<td colspan="3"><p align="center">
<span class="Coramy">Coramy</span><span class="Entete">5 bis, rue Denis Cordonnier - 59820 GRAVELINES - Tel : 03 28 51 91 51 -
Fax : 03 28 23 34 96</span><br>&#201;chantillonnage N <span tal:content="here/getId"/> - <span tal:define="url_items python:modules['string'].split(acheteur.getGender(),'/')"
tal:content="python:(len(url_items)-1)*url_items[len(url_items)-1]">
</span> <span tal:content="python:modules['string'].capwords(modules['string'].lower(acheteur.getTitle()))"/> - <span tal:content="python:modules['string'].capwords(modules['string'].lower(client.getTitle()))"/>
- <span tal:content="python:modules['string'].capwords(modules['string'].lower(here.getDescription()))"/><br> &nbsp;<br></p></td>
<td></td>
<td></td>
</tr>
<span tal:repeat="i python:range(lin_nb)">
<tr valign="top" class="Border">
<span tal:repeat="j python:map((lambda x:x+(page_no*col_nb*lin_nb)+(i*col_nb)),range(col_nb))">
<span tal:condition="python:j<nb_echantillons">
<td valign="top" align="center" width="50%" class="Border" tal:define="ligne python:lignes_cde[lignes_index[j]]">
<span tal:condition="python:ligne.getDefaultValue('resource',portal_type=['Modele'])<>None">
<span tal:define="modele python:ligne.getDefaultValue('resource',portal_type=['Modele']);
coloris_list python:modele.contentValues(filter={'portal_type':'Variante Modele'})
">
<span tal:define="url_items1 python:modules['string'].split(ligne.getResourceRelativeUrl(),'/')"
tal:content="structure python:'Modle : '+'<b>'+url_items1[len(url_items1)-1]+'</b>'">modele</span>
<span tal:condition="python:ligne.getColoris() <> None">
<span tal:define="url_items2 python:modules['string'].split(ligne.getColoris(),'/')"
tal:content="structure python:' coloris '+url_items2[len(url_items2)-1]">modele</span>
</span>
<br>
<span tal:content="python:modules['string'].capwords(modules['string'].lower(modele.getComposition()))"/>
<br>
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="280" height="280" align="center" valign="top">
<span tal:repeat="coloris coloris_list">
<span tal:condition="python:coloris.getRelativeUrl()==ligne.getColoris()">
<img tal:condition="python:coloris.width()>=coloris.height()"
src="" tal:attributes="src python:coloris.absolute_url() + '?display=small&format=jpeg&resolution=150'" width="100%"/>
<img tal:condition="python:coloris.width()<coloris.height()"
src="" tal:attributes="src python:coloris.absolute_url() + '?display=small&format=jpeg&resolution=150'" height="100%"/>
</span>
</span>
</td>
</tr>
</table>
<br>
<span tal:define="tarif_list python:ligne.contentValues(filter={'portal_type':'Element Tarif'})">
<table border="1" cellspacing="0" cellpadding="0" width="100%">
<tr>
<span tal:condition="python:len(tarif_list)>0">
<td><i>Prix &#8364;/Quantits</i></td>
<td tal:condition="python:tarif_list[0].getCell(None, '00300', base_id='destination_base_price')<>None"
tal:content="python:'300p'">
</td>
<td tal:condition="python:tarif_list[0].getCell(None, '01000', base_id='destination_base_price')<>None"
tal:content="python:'1000p'">
</td>
<td tal:condition="python:tarif_list[0].getCell(None, '05000', base_id='destination_base_price')<>None"
tal:content="python:'5000p'">
</td>
<td tal:condition="python:tarif_list[0].getCell(None, '10000', base_id='destination_base_price')<>None"
tal:content="python:'10000p'">
</td>
</span>
</tr>
<span tal:repeat="tarif_item tarif_list">
<tr>
<td tal:content="python:modules['string'].lower(tarif_item.getDescription())"/>
<td tal:condition="python:tarif_item.getCell(None, '00300', base_id='destination_base_price')<>None"
tal:content="python:'%.2f' %tarif_item.getCell(None, '00300', base_id='destination_base_price').destination_base_price or nothing">
</td>
<td tal:condition="python:tarif_item.getCell(None, '01000', base_id='destination_base_price')<>None"
tal:content="python:'%s' %tarif_item.getCell(None, '01000', base_id='destination_base_price').destination_base_price or nothing">
</td>
<td tal:condition="python:tarif_item.getCell(None, '05000', base_id='destination_base_price')<>None"
tal:content="python:'%.2f' %tarif_item.getCell(None, '05000', base_id='destination_base_price').destination_base_price or nothing">
</td>
<td tal:condition="python:tarif_item.getCell(None, '10000', base_id='destination_base_price')<>None"
tal:content="python:'%.2f' %tarif_item.getCell(None, '10000', base_id='destination_base_price').destination_base_price or nothing">
</td>
</tr>
</span>
</table>
</span>
</span>
</span>
</td>
</span>
</span>
</tr>
</span>
<tr>
<td colspan="2" align="center" class="Entete"><p>&#169; Coramy - All rights reserved<br>This document is the confidential property of CORAMY<br>Anyone who divulges this plan is rendering
himself liable of legal proceedings</p></td>
<td></td>
</tr>
</table>
<span tal:define="client python:here.getDefaultValue('destination',portal_type=['Organisation']);
acheteur python:here.getDefaultValue('contact',portal_type=['Person']);
lignes_cde python:here.contentValues(filter={'portal_type':'Sample Order Line'});
lignes_index python:here.ordered_lines(lignes_cde=lignes_cde);
nb_echantillons python:len(lignes_cde);
col_nb python:4;
lin_nb python:5;
nb_pages python:here.echantillon_page_count(total_nb=nb_echantillons,on_page=col_nb*lin_nb)
">
<table tal:repeat="page_no python:range(nb_pages)" class="PageA4" width="660" height="955" border="0" cellpadding="0" cellspacing="0">
<tr>
<td colspan="4"><p align="center">
<span class="Coramy">Coramy</span><span class="Entete">5 bis, rue Denis Cordonnier - 59820 GRAVELINES - Tel : 03 28 51 91 51 -
Fax : 03 28 23 34 96</span><br>&#201;chantillonnage N <span tal:content="here/getId"/> - <span tal:define="url_items python:modules['string'].split(acheteur.getGender(),'/')"
tal:content="python:url_items[len(url_items)-1]">
</span> <span tal:content="python:modules['string'].capwords(modules['string'].lower(acheteur.getTitle()))"/> - <span tal:content="python:modules['string'].capwords(modules['string'].lower(client.getTitle()))"/>
- <span tal:content="python:modules['string'].capwords(modules['string'].lower(here.getDescription()))"/><br> &nbsp;<br></p></td>
<td></td>
<td></td>
<td></td>
</tr>
<span tal:repeat="i python:range(lin_nb)">
<tr valign="top" class="Border">
<span tal:repeat="j python:map((lambda x:x+(page_no*col_nb*lin_nb)+(i*col_nb)),range(col_nb))">
<span tal:condition="python:j<nb_echantillons">
<td valign="top" align="center" width="25%" class="Border" nowrap tal:define="ligne python:lignes_cde[lignes_index[j]]">
<span tal:condition="python:ligne.getDefaultValue('resource',portal_type=['Modele'])<>None">
<span tal:define="modele python:ligne.getDefaultValue('resource',portal_type=['Modele']);
coloris_list python:modele.contentValues(filter={'portal_type':'Variante Modele'})
">
<span tal:define="url_items1 python:modules['string'].split(ligne.getResourceRelativeUrl(),'/')"
tal:content="python:url_items1[len(url_items1)-1]">modele</span>
<br>&nbsp;<br>
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="90" height="90" align="center" valign="center">
<span tal:repeat="coloris coloris_list">
<span tal:condition="python:coloris.getRelativeUrl()==ligne.getColoris()">
<img tal:condition="python:coloris.width()>=coloris.height()"
src="" tal:attributes="src python:coloris.absolute_url() + '?display=small&format=jpeg&resolution=100'" width="100%"/>
<img tal:condition="python:coloris.width()<coloris.height()"
src="" tal:attributes="src python:coloris.absolute_url() + '?display=small&format=jpeg&resolution=100'" height="100%"/>
</span>
</span>
</td>
</tr>
</table>
</span>
</span>
</td>
</span>
</span>
</tr>
</span>
<tr>
<td colspan="4" align="center" class="Entete"><p>&#169; Coramy - All rights reserved<br>This document is the confidential property of CORAMY<br>Anyone who divulges this plan is rendering
himself liable of legal proceedings</p></td>
<td></td><td></td><td></td>
</tr>
</table></span>
</body>
</html>
<?xml version="1.0" encoding="iso-8859-1"?>
<form>
<title>Facture vente</title>
<name>sales_order_view</name>
<action>base_edit</action>
<enctype>multipart/form-data</enctype>
<method>POST</method>
<pt>form_view</pt>
<groups>
<group>
<title>left</title>
<fields>
<field><id>my_id</id> <type>StringField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default></default>
<description></description>
<display_maxwidth></display_maxwidth>
<display_width type="int">10</display_width>
<external_validator></external_validator>
<extra></extra>
<hidden type="int">0</hidden>
<max_length></max_length>
<required type="int">1</required>
<title>Identifiant</title>
<truncate type="int">0</truncate>
</values>
<tales>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="too_long">Too much input was given.</message>
</messages>
</field>
<field><id>my_source_section</id> <type>ListField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default></default>
<description></description>
<external_validator></external_validator>
<extra></extra>
<first_item type="int">0</first_item>
<hidden type="int">0</hidden>
<items type="list">[]</items>
<required type="int">0</required>
<size type="int">1</size>
<title>Socit</title>
</values>
<tales>
<items>python:here.portal_categories.group.Coramy.getCategoryChildIdItemList(base=1,display_none_category=1)</items>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="unknown_selection">You selected an item that was not in the list.</message>
</messages>
</field>
<field><id>my_reference</id> <type>StringField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default></default>
<description></description>
<display_maxwidth></display_maxwidth>
<display_width type="int">10</display_width>
<external_validator></external_validator>
<extra></extra>
<hidden type="int">0</hidden>
<max_length></max_length>
<required type="int">0</required>
<title>Numro de facture</title>
<truncate type="int">0</truncate>
</values>
<tales>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="too_long">Too much input was given.</message>
</messages>
</field>
<field><id>my_description</id> <type>TextAreaField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default></default>
<description></description>
<external_validator></external_validator>
<extra></extra>
<height type="int">3</height>
<hidden type="int">0</hidden>
<max_length></max_length>
<max_linelength></max_linelength>
<max_lines></max_lines>
<required type="int">0</required>
<title>Description</title>
<width type="int">40</width>
</values>
<tales>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="too_many_lines">You entered too many lines.</message>
<message name="line_too_long">A line was too long.</message>
<message name="too_long">You entered too many characters.</message>
</messages>
</field>
<field><id>my_source_administration_title</id> <type>RelationStringField</type>
<values>
<alternate_name></alternate_name>
<base_category>source_administration</base_category>
<catalog_index>Title</catalog_index>
<css_class></css_class>
<default></default>
<default_module>person</default_module>
<description></description>
<display_maxwidth></display_maxwidth>
<display_width type="int">20</display_width>
<external_validator></external_validator>
<extra></extra>
<hidden type="int">0</hidden>
<jump_method>base_jump_relation</jump_method>
<max_length></max_length>
<portal_type type="list">[('Person', 'Person')]</portal_type>
<required type="int">0</required>
<title>Gestionaire</title>
<truncate type="int">0</truncate>
<update_method>base_update_relation</update_method>
</values>
<tales>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="too_long">Too much input was given.</message>
</messages>
</field>
<field><id>my_start_date</id> <type>DateTimeField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<date_only type="int">1</date_only>
<date_separator>/</date_separator>
<default_now type="int">0</default_now>
<description></description>
<external_validator></external_validator>
<hidden type="int">0</hidden>
<input_order>dmy</input_order>
<input_style>text</input_style>
<required type="int">0</required>
<time_separator>:</time_separator>
<title>Date de facture</title>
</values>
<tales>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="not_datetime">You did not enter a valid date and time.</message>
<message name="datetime_out_of_range">The date and time you entered were out of range.</message>
</messages>
</field>
<field><id>my_price_currency</id> <type>ListField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default></default>
<description></description>
<external_validator></external_validator>
<extra></extra>
<first_item type="int">0</first_item>
<hidden type="int">0</hidden>
<items type="list">[]</items>
<required type="int">0</required>
<size type="int">1</size>
<title>Devise</title>
</values>
<tales>
<items>python:[('','')]+map(lambda x:(x.id,'devise/%s' %x.id),here.devise.objectValues())</items>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="unknown_selection">You selected an item that was not in the list.</message>
</messages>
</field>
<field><id>simulation_state</id> <type>StringField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default></default>
<description></description>
<display_maxwidth></display_maxwidth>
<display_width type="int">20</display_width>
<external_validator></external_validator>
<extra></extra>
<hidden type="int">0</hidden>
<max_length></max_length>
<required type="int">0</required>
<title>Etat</title>
<truncate type="int">0</truncate>
</values>
<tales>
<default>python:here.portal_workflow.getInfoFor(here, 'simulation_state')</default>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="too_long">Too much input was given.</message>
</messages>
</field>
</fields>
</group>
<group>
<title>right</title>
<fields>
<field><id>my_causality_id</id> <type>RelationStringField</type>
<values>
<alternate_name></alternate_name>
<base_category>causality</base_category>
<catalog_index>id</catalog_index>
<css_class></css_class>
<default></default>
<default_module>livraison_vente</default_module>
<description></description>
<display_maxwidth></display_maxwidth>
<display_width type="int">10</display_width>
<external_validator></external_validator>
<extra></extra>
<hidden type="int">0</hidden>
<jump_method>base_jump_relation</jump_method>
<max_length></max_length>
<portal_type type="list">[('Sales Packing List', 'Sales Packing List')]</portal_type>
<required type="int">0</required>
<title>N livraison</title>
<truncate type="int">0</truncate>
<update_method>base_update_relation</update_method>
</values>
<tales>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="too_long">Too much input was given.</message>
</messages>
</field>
<field><id>my_destination_title</id> <type>RelationStringField</type>
<values>
<alternate_name></alternate_name>
<base_category>destination</base_category>
<catalog_index>Title</catalog_index>
<css_class></css_class>
<default></default>
<default_module>organisation</default_module>
<description></description>
<display_maxwidth></display_maxwidth>
<display_width type="int">20</display_width>
<external_validator></external_validator>
<extra></extra>
<hidden type="int">0</hidden>
<jump_method>base_jump_relation</jump_method>
<max_length></max_length>
<portal_type type="list">[('Organisation', 'Organisation')]</portal_type>
<required type="int">0</required>
<title>Livrer </title>
<truncate type="int">0</truncate>
<update_method>base_update_relation</update_method>
</values>
<tales>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="too_long">Too much input was given.</message>
</messages>
</field>
<field><id>my_destination_section_title</id> <type>RelationStringField</type>
<values>
<alternate_name></alternate_name>
<base_category>destination</base_category>
<catalog_index>Title</catalog_index>
<css_class></css_class>
<default></default>
<default_module>organisation</default_module>
<description></description>
<display_maxwidth></display_maxwidth>
<display_width type="int">20</display_width>
<external_validator></external_validator>
<extra></extra>
<hidden type="int">0</hidden>
<jump_method>base_jump_relation</jump_method>
<max_length></max_length>
<portal_type type="list">[('Organisation', 'Organisation')]</portal_type>
<required type="int">0</required>
<title>Pour le compte de</title>
<truncate type="int">0</truncate>
<update_method>base_update_relation</update_method>
</values>
<tales>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="too_long">Too much input was given.</message>
</messages>
</field>
<field><id>my_value_added_tax_recoverable</id> <type>CheckBoxField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default type="int">0</default>
<description></description>
<external_validator></external_validator>
<extra></extra>
<hidden type="int">0</hidden>
<title>Soumis la T.V.A.</title>
</values>
<tales>
<default>here/getValueAddedTaxRecoverable</default>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
</messages>
</field>
<field><id>my_value_added_tax_ratio</id> <type>FloatField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default></default>
<description></description>
<display_maxwidth></display_maxwidth>
<display_width type="int">10</display_width>
<external_validator></external_validator>
<extra></extra>
<hidden type="int">0</hidden>
<required type="int">0</required>
<title>Taux de TVA</title>
</values>
<tales>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="not_float">You did not enter a floating point number.</message>
</messages>
</field>
<field><id>my_incoterm</id> <type>ListField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default></default>
<description></description>
<external_validator></external_validator>
<extra></extra>
<first_item type="int">0</first_item>
<hidden type="int">0</hidden>
<items type="list">[]</items>
<required type="int">0</required>
<size type="int">1</size>
<title>Incoterm</title>
</values>
<tales>
<items>python:here.portal_categories.incoterm.getCategoryChildItemList(display_id = 'getTitle', display_none_category=1)</items>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="unknown_selection">You selected an item that was not in the list.</message>
</messages>
</field>
<field><id>my_delivery_mode</id> <type>ListField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default></default>
<description></description>
<external_validator></external_validator>
<extra></extra>
<first_item type="int">0</first_item>
<hidden type="int">0</hidden>
<items type="list">[]</items>
<required type="int">0</required>
<size type="int">1</size>
<title>Mode de livraison</title>
</values>
<tales>
<items>here/portal_categories/delivery_mode/getFormItemList</items>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="unknown_selection">You selected an item that was not in the list.</message>
</messages>
</field>
</fields>
</group>
<group>
<title>center</title>
<fields>
<field><id>my_comment</id> <type>TextAreaField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default></default>
<description></description>
<external_validator></external_validator>
<extra></extra>
<height type="int">3</height>
<hidden type="int">0</hidden>
<max_length></max_length>
<max_linelength></max_linelength>
<max_lines></max_lines>
<required type="int">0</required>
<title>Commentaires</title>
<width type="int">80</width>
</values>
<tales>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="too_many_lines">You entered too many lines.</message>
<message name="line_too_long">A line was too long.</message>
<message name="too_long">You entered too many characters.</message>
</messages>
</field>
<field><id>total_ht</id> <type>FloatField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default></default>
<description></description>
<display_maxwidth></display_maxwidth>
<display_width type="int">10</display_width>
<external_validator></external_validator>
<extra></extra>
<hidden type="int">1</hidden>
<required type="int">0</required>
<title>Total H.T.</title>
</values>
<tales>
<title>python:'Total H.T. : %.2f' % here.getTotalPrice()</title>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="not_float">You did not enter a floating point number.</message>
</messages>
</field>
<field><id>montant_taxable</id> <type>FloatField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default></default>
<description></description>
<display_maxwidth></display_maxwidth>
<display_width type="int">10</display_width>
<external_validator></external_validator>
<extra></extra>
<hidden type="int">1</hidden>
<required type="int">0</required>
<title>Montant taxable</title>
</values>
<tales>
<title>python:'Montant taxable : %.2f' % here.Invoice_zGetTotalNetPrice()</title>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="not_float">You did not enter a floating point number.</message>
</messages>
</field>
<field><id>vat</id> <type>FloatField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default></default>
<description></description>
<display_maxwidth></display_maxwidth>
<display_width type="int">10</display_width>
<external_validator></external_validator>
<extra></extra>
<hidden type="int">1</hidden>
<required type="int">0</required>
<title>TVA</title>
</values>
<tales>
<title>python:'TVA : %.2f' % here.Invoice_zGetTotalVat()</title>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="not_float">You did not enter a floating point number.</message>
</messages>
</field>
<field><id>total_price</id> <type>FloatField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default></default>
<description></description>
<display_maxwidth></display_maxwidth>
<display_width type="int">10</display_width>
<external_validator></external_validator>
<extra></extra>
<hidden type="int">1</hidden>
<required type="int">0</required>
<title>Net payer</title>
</values>
<tales>
<title>python:'Net payer : %.2f' % (here.Invoice_zGetTotalVat() + here.Invoice_zGetTotalNetPrice())</title>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="not_float">You did not enter a floating point number.</message>
</messages>
</field>
<field><id>due_date</id> <type>DateTimeField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<date_only type="int">1</date_only>
<date_separator>/</date_separator>
<default_now type="int">0</default_now>
<description></description>
<external_validator></external_validator>
<hidden type="int">1</hidden>
<input_order>dmy</input_order>
<input_style>text</input_style>
<required type="int">0</required>
<time_separator>:</time_separator>
<title>Date d'chance</title>
</values>
<tales>
<title>python:'Date d chance : ' + here.Invoice_zGetDueDate().strftime('%d/%m/%Y')</title>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="not_datetime">You did not enter a valid date and time.</message>
<message name="datetime_out_of_range">The date and time you entered were out of range.</message>
</messages>
</field>
</fields>
</group>
<group>
<title>bottom</title>
<fields>
<field><id>listbox</id> <type>ListBox</type>
<values>
<all_columns type="list">[]</all_columns>
<all_editable_columns type="list">[]</all_editable_columns>
<alternate_name></alternate_name>
<columns type="list">[('id', 'Ligne'), ('getResourceRelativeUrl', 'Produit'), ('description', 'Description'), ('total_quantity', 'Quantit\xe9 totale'), ('total_price', 'Montant total')]</columns>
<css_class></css_class>
<default></default>
<default_params type="list">[]</default_params>
<description></description>
<domain_root_list type="list">[]</domain_root_list>
<domain_tree type="int">0</domain_tree>
<editable_columns type="list">[('description', 'Description')]</editable_columns>
<external_validator></external_validator>
<global_attributes type="list">[]</global_attributes>
<hidden type="int">0</hidden>
<lines type="int">10</lines>
<list_action>folder_contents</list_action>
<list_method type="method">searchFolder</list_method>
<meta_types type="list">[]</meta_types>
<portal_types type="list">[('Invoice Line', 'Invoice Line')]</portal_types>
<report_root_list type="list">[]</report_root_list>
<report_tree type="int">0</report_tree>
<search type="int">0</search>
<search_columns type="list">[]</search_columns>
<select type="int">0</select>
<selection_name>invoice_line_selection</selection_name>
<sort type="list">[('id', 'id')]</sort>
<stat_method></stat_method>
<title>Lignes de facture</title>
</values>
<tales>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
</messages>
</field>
</fields>
</group>
<group>
<title>hidden</title>
<fields>
<field><id>listbox_description</id> <type>StringField</type>
<values>
<alternate_name></alternate_name>
<css_class></css_class>
<default></default>
<description></description>
<display_maxwidth></display_maxwidth>
<display_width type="int">40</display_width>
<external_validator></external_validator>
<extra></extra>
<hidden type="int">0</hidden>
<max_length></max_length>
<required type="int">0</required>
<title>listbox_description</title>
<truncate type="int">0</truncate>
</values>
<tales>
</tales>
<messages>
<message name="external_validator_failed">The input failed the external validator.</message>
<message name="required_not_found">Input is required but no input given.</message>
<message name="too_long">Too much input was given.</message>
</messages>
</field>
</fields>
</group>
</groups>
</form>
<HTML>
<HEAD>
<meta http-equiv="content-type" content="text/html;charset=ISO-8859-1">
<title tal:content="here/getTitle">Coramy</title>
<link rel=stylesheet type="text/css" href="modele_catalog_c">
</HEAD>
<BODY bgcolor="#ffffff" tal:define="delivery_dict python:here.SalesPackingList_buildRemiseTransporteurDict();
page_number python:[0]">
<SPAN tal:repeat="societe python:delivery_dict.keys()">
<SPAN tal:repeat="transporteur python:delivery_dict[societe].keys()"
tal:define="totalizer python:[0,0,0,0]">
<TABLE border="0" width="660" height="900" cellpadding="0" cellspacing="0"
tal:define="transporteur_items python:transporteur.split('/');
pretty_transporteur python:transporteur_items[len(transporteur_items)-1]"><!-- Tableau general -->
<TR>
<TD>
<TABLE border="0" width="100%" height="100%">
<TR>
<TD class="Titre" tal:content="societe">Coramy</TD>
<TD align="center">
<span class="Titre2">Remise de colis <span tal:content="pretty_transporteur"/></span>
</TD>
<TD align="right">
<span tal:content="python:'Gravelines, le '+str(here.DateTime_getFormattedDate())"/>
</TD>
</TR>
</TABLE>
</TD>
</TR>
<TR height="18%"><!-- Infos -->
<TD><br>
<TABLE border="1" width="100%" height="100%">
<TR>
<TD>Destinataire
</TD>
<TD nowrap>No Livraison
</TD>
<TD nowrap>No Commande client
</TD>
<TD>Nb Colis
</TD>
<TD>Poids (kg)
</TD>
</TR>
<SPAN tal:repeat="destination_organisation python:delivery_dict[societe][transporteur].keys()" width="660" height="955" cellpadding="0" cellspacing="0" tal:attributes="class python:here.PT_pageBreak(page_number)">
<TR>
<SPAN tal:define="destination python:here.restrictedTraverse(destination_organisation);
toto python:here.PT_reset_total_list(totalizer,[1,3])">
<TD valign="top" tal:attributes="rowspan python:len(delivery_dict[societe][transporteur][destination_organisation])+2">
<SPAN tal:condition="python:destination<>None">
<b><SPAN tal:content="python:modules['string'].capwords(destination.getTitle())"/></b>
<br><SPAN tal:condition="python:destination.getPortalType()<>'Category'">
<SPAN tal:define="address_items python:modules['string'].
split(destination.getDefaultAddress().asText(country='France'),'\n')">
<SPAN tal:repeat="item address_items">
<SPAN tal:content="item"/><br>
</SPAN>
</SPAN>
</SPAN>
</SPAN>
</TD>
</SPAN>
</TR>
<SPAN tal:repeat="delivery python:delivery_dict[societe][transporteur][destination_organisation]">
<TR><!-- Dtail des livraisons -->
<TD tal:content="python:delivery.getId()">
</TD>
<TD tal:define="order python:delivery.getCausalityValue(portal_type=['Sales Order'])">
<SPAN tal:content="python:order.getDestinationReference()"/>
</TD>
<TD align="right" tal:define="colis_nb python:len(delivery.contentValues(filter={'portal_type':'Container'}))">
<SPAN tal:define="toto python:delivery.PT_update_total_list(totalizer,[0,1],colis_nb)"/>
<SPAN tal:content="colis_nb"/>
</TD>
<TD align="right" tal:define="weight python:delivery.PackingList_getTotalGrossWeight()">
<SPAN tal:define="toto python:delivery.PT_update_total_list(totalizer,[2,3],weight)"/>
<SPAN tal:content="python:'%.1f' %weight"/>
</TD>
</TR>
</SPAN>
<TR> <!-- Totaux par destinataire -->
<TD align="right" colspan="2"><b>Sous-total</b>
</TD>
<TD align="right"><b>
<SPAN tal:content="python:totalizer[1]"/></b>
</TD>
<TD align="right"><b>
<SPAN tal:content="python:'%.1f' %totalizer[3]"/></b>
</TD>
</TR>
</SPAN>
<TR> <!-- Totaux par transporteur -->
<TD align="right" colspan="3"><b>TOTAL</b>
</TD>
<TD align="right"><b>
<SPAN tal:content="python:totalizer[0]"/></b>
</TD>
<TD align="right"><b>
<SPAN tal:content="python:'%.1f' %totalizer[2]"/></b>
</TD>
</TR>
<TR>
<TD colspan="5">
<b><SPAN tal:content="python:'Je reconnais avoir pris en charge %s colis pour un poids approximatif de %s kg pour le compte de la socit %s.' %(totalizer[0],totalizer[2],pretty_transporteur)"/></b><br>Le chauffeur
</TD>
</TR>
</TABLE>
</TD>
</TR>
<TR>
<TD tal:condition="python:societe=='BLS'" align="center">BLS - 5 bis, rue Denis Cordonnier - 59820 Gravelines (FRANCE)<br>Tl. : + 33 (0) 3 28 51 86 26 - Fax : + 33 (0) 3 28 23 34 96
<p class="Copy">S.A.R.L. au capital de 10.000 - T.V.A. FR 51 442 959 243 - R.C. Dunkerque 442 959 243 - SIRET 442 959 243 00019</p>
</TD>
<TD tal:condition="python:societe=='Houvenaegel'" align="center">Houvenaegel Cration - 5 bis, rue Denis Cordonnier - 59820 Gravelines (FRANCE)<br>Tl. : + 33 (0) 3 28 51 91 55 - Fax : + 33 (0) 3 28 23 34 96
<p class="Copy">S.A.R.L. au capital de 7.622,45 - T.V.A. FR 07 422 769 810 - R.C. Dunkerque 422 769 810 - SIRET 422 769 810 00025</p>
</TD>
<TD tal:condition="python:societe=='Coramy'" align="center">Coramy - 5 bis, rue Denis Cordonnier - 59820 Gravelines (FRANCE)<br>Tl. : + 33 (0) 3 28 51 91 51 - Fax : + 33 (0) 3 28 23 34 96
<p class="Copy">S.A.S. au capital de 435.200 - T.V.A. FR 67 611 750 274 - R.C. Dunkerque 611 750 274 - SIRET 611 750 274 00023 - CNUF 15971</p>
</TD>
</TR>
</TABLE>
</SPAN>
</SPAN>
</BODY>
</HTML>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment