Commit 534843ce authored by Jérome Perrin's avatar Jérome Perrin

style changes

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@22690 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent ceb343ce
......@@ -65,7 +65,7 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>T_ = context.Base_translateString\n
<value> <string>translateString = context.Base_translateString\n
request = context.REQUEST\n
\n
def getFieldAsString(field):\n
......@@ -98,25 +98,26 @@ def getOneLineAddress(text, region):\n
def getPhoneAndFax(phone, fax):\n
s = \'\'\n
if phone:\n
s += \'%s: %s\' % (T_(\'tel.\'), phone)\n
s += \'%s: %s\' % (translateString(\'tel.\'), phone)\n
if fax:\n
if s: s += \', \'\n
s += \'%s: %s\' % (T_(\'fax\'), fax)\n
s += \'%s: %s\' % (translateString(\'fax\'), fax)\n
return s\n
\n
def getEmail(email):\n
s = \'\'\n
if email:\n
s += \'%s: %s\' % (T_(\'email\'), email)\n
s += \'%s: %s\' % (translateString(\'email\'), email)\n
return s\n
\n
def getVatId(vat_id):\n
s = \'\'\n
if vat_id:\n
s += \'%s: %s\' % (T_(\'VAT ID\'), vat_id)\n
s += \'%s: %s\' % (translateString(\'VAT ID\'), vat_id)\n
return s\n
\n
preferred_date_order = context.getPortalObject().portal_preferences.getPreferredDateOrder() or \'ymd\'\n
preferred_date_order = context.getPortalObject().portal_preferences\\\n
.getPreferredDateOrder() or \'ymd\'\n
separator = \'/\'\n
def getOrderedDate(date):\n
if date is None:\n
......@@ -127,10 +128,10 @@ def getOrderedDate(date):\n
\n
def getPaymentConditionText(order):\n
if order.getPaymentConditionPaymentEndOfMonth():\n
return T_("End of Month")\n
return translateString("End of Month")\n
days = order.getPaymentConditionPaymentTerm()\n
if days:\n
return \'%s %s\' % (days, T_(\'Days\'))\n
return \'%s %s\' % (days, translateString(\'Days\'))\n
return \'\'\n
\n
line_list = []\n
......@@ -148,8 +149,10 @@ for line in getSubLineList(context):\n
prod_desc = line.getResource() is not None and \\\n
line.getResourceValue().getDescription() or line.getResourceTitle()\n
desc = getProductAndLineDesc(prod_desc, line.getDescription())\n
if getattr(line, \'hasLineContent\', None) is not None and line.hasLineContent()\\\n
or getattr(line, \'hasCellContent\', None) is not None and line.hasCellContent():\n
if getattr(line, \'hasLineContent\', None) is not None\\\n
and line.hasLineContent()\\\n
or getattr(line, \'hasCellContent\', None) is not None\\\n
and line.hasCellContent():\n
# summary\n
line_dict = {\n
\'style_name\': \'Item_20_Table_20_Title\',\n
......@@ -157,7 +160,8 @@ for line in getSubLineList(context):\n
\'right_style_name\': \'Item_20_Table_20_Title_20_Right\',\n
\'index\': line.getReference() or line.getIntIndex(),\n
\'source_reference\': getSourceReference(line),\n
\'reference\': line.getResource() is not None and line.getResourceValue().getReference() or \'\',\n
\'reference\': line.getResource() is not None\\\n
and line.getResourceValue().getReference() or \'\',\n
\'description\': desc,\n
\'total_quantity\': \'\',\n
\'quantity_unit\': \'\',\n
......@@ -179,52 +183,70 @@ for line in getSubLineList(context):\n
\'right_style_name\': \'Table_20_Contents_20_Right\',\n
\'index\': line.getReference() or line.getIntIndex(),\n
\'source_reference\': getSourceReference(line),\n
\'reference\': line.getResource() is not None and line.getResourceValue().getReference() or \'\',\n
\'reference\': line.getResource() is not None\\\n
and line.getResourceValue().getReference() or \'\',\n
\'description\': desc,\n
\'total_quantity\': line.getTotalQuantity() or \'\',\n
\'quantity_unit\': line.getQuantityUnitTitle() or (line.getResource() and line.getResourceValue().getQuantityUnitTitle()) or \'\',\n
\'quantity_unit\': line.getQuantityUnitTitle() or (\n
line.getResource() and line.getResourceValue().getQuantityUnitTitle()) or \'\',\n
\'stop_date\': getOrderedDate(line.getStopDate()) or \'\',\n
\'base_price\': line.getPrice() or \'\',\n
\'total_price\': line.getTotalPrice() or \'\',\n
\'specialise_title\' : getattr(line,\'getSpecialiseTitle\',None) is not None and (line.getSpecialiseTitle() or \'\') or \'\',\n
\'specialise_title\' : line.getProperty(\'specialise_title\', \'\'),\n
}\n
total_price += line.getTotalPrice() or 0.0\n
line_list.append(unicodeDict(line_dict.copy()))\n
inch_cm_ratio = 2.54 / 100.0\n
data_dict = {\n
\'source_section_title\': context.getSourceSectionTitle() or \'\',\n
\'source_section_image_path\': context.getSourceSectionValue() is not None and context.getSourceSectionValue().getDefaultImagePath() or \'\',\n
\'source_section_image_path\': context.getSourceSectionValue() is not None\\\n
and context.getSourceSectionValue().getDefaultImagePath() or \'\',\n
\'source_section_image_width\': context.getSourceSectionValue() is not None\\\n
and context.getSourceSectionValue().getDefaultImageWidth() is not None\\\n
and context.getSourceSectionValue().getDefaultImageWidth() * inch_cm_ratio or \'\',\n
and context.getSourceSectionValue().getDefaultImageWidth() \\\n
* inch_cm_ratio or \'\',\n
\'source_section_image_height\': context.getSourceSectionValue() is not None\\\n
and context.getSourceSectionValue().getDefaultImageHeight() is not None\\\n
and context.getSourceSectionValue().getDefaultImageHeight() * inch_cm_ratio or \'\',\n
and context.getSourceSectionValue().getDefaultImageHeight() \\\n
* inch_cm_ratio or \'\',\n
\'source_section_address\': getOneLineAddress(\n
context.getSourceSection() and context.getSourceSectionValue().getDefaultAddressText() or \'\',\n
context.getSourceSection() and context.getSourceSectionValue().getDefaultAddressRegionTitle() or \'\'),\n
\'source_section_telfax\': getPhoneAndFax(context.getSourceSection() and context.getSourceSectionValue().getTelephoneText() or \'\',\n
context.getSourceSection() and context.getSourceSectionValue().getFaxText() or \'\'),\n
\'source_section_email\': getEmail(context.getSourceSection() and context.getSourceSectionValue().getEmailText() or \'\'),\n
context.getSourceSection() and\n
context.getSourceSectionValue().getDefaultAddressText() or \'\',\n
context.getSourceSection() and \n
context.getSourceSectionValue().getDefaultAddressRegionTitle() or \'\'),\n
\'source_section_telfax\': getPhoneAndFax(context.getSourceSection() and \\\n
context.getSourceSectionValue().getTelephoneText() or \'\',\n
context.getSourceSection() and \\\n
context.getSourceSectionValue().getFaxText() or \'\'),\n
\'source_section_email\': getEmail(context.getSourceSection() and\n
context.getSourceSectionValue().getEmailText() or \'\'),\n
\'source_section_vatid\': getVatId(context.getSourceSection() and\\\n
getattr(context.getSourceSectionValue(), \'getVatCode\', None)\\\n
is not None and\\\n
context.getSourceSectionValue().getVatCode() or \'\'),\n
\n
\'source_decision_title\': context.getSourceDecisionTitle() or \'\',\n
\'source_decision_image_path\': context.getSourceDecisionValue() is not None and context.getSourceDecisionValue().getDefaultImagePath() or \'\',\n
\'source_decision_image_path\': context.getSourceDecisionValue() is not None\\\n
and context.getSourceDecisionValue().getDefaultImagePath() or \'\',\n
\'source_decision_image_width\': context.getSourceDecisionValue() is not None\\\n
and context.getSourceDecisionValue().getDefaultImageWidth() is not None\\\n
and context.getSourceDecisionValue().getDefaultImageWidth() * inch_cm_ratio or \'\',\n
and context.getSourceDecisionValue().getDefaultImageWidth() \\\n
* inch_cm_ratio or \'\',\n
\'source_decision_image_height\': context.getSourceDecisionValue() is not None\\\n
and context.getSourceDecisionValue().getDefaultImageHeight() is not None\\\n
and context.getSourceDecisionValue().getDefaultImageHeight() * inch_cm_ratio or \'\',\n
and context.getSourceDecisionValue().getDefaultImageHeight() \\\n
* inch_cm_ratio or \'\',\n
\'source_decision_address\':getOneLineAddress(\n
context.getSourceDecision() and context.getSourceDecisionValue().getDefaultAddressText() or \'\',\n
context.getSourceDecision() and context.getSourceDecisionValue().getDefaultAddressRegionTitle() or \'\'),\n
\'source_decision_telfax\': getPhoneAndFax(context.getSourceDecision() and context.getSourceDecisionValue().getTelephoneText() or \'\',\n
context.getSourceDecision() and context.getSourceDecisionValue().getFaxText() or \'\'),\n
\'source_decision_email\': getEmail(context.getSourceDecision() and context.getSourceDecisionValue().getEmailText() or \'\'),\n
context.getSourceDecision() and \n
context.getSourceDecisionValue().getDefaultAddressText() or \'\',\n
context.getSourceDecision() and \\\n
context.getSourceDecisionValue().getDefaultAddressRegionTitle() or \'\'),\n
\'source_decision_telfax\': getPhoneAndFax(context.getSourceDecision() and\n
context.getSourceDecisionValue().getTelephoneText() or \'\',\n
context.getSourceDecision() and \\\n
context.getSourceDecisionValue().getFaxText() or \'\'),\n
\'source_decision_email\': getEmail(context.getSourceDecision() and\n
context.getSourceDecisionValue().getEmailText() or \'\'),\n
\'source_decision_vatid\': getVatId(context.getSourceDecision() and\\\n
getattr(context.getSourceDecisionValue(), \'getVatCode\', None)\\\n
is not None and\\\n
......@@ -232,14 +254,19 @@ data_dict = {\n
\n
\'destination_title\': context.getDestinationTitle() or \'\',\n
\'destination_address\': getOneLineAddress(\n
context.getDestination() and context.getDestinationValue().getDefaultAddressText() or \'\',\n
context.getDestination() and context.getDestinationValue().getDefaultAddressRegionTitle() or \'\'),\n
\'destination_telfax\': getPhoneAndFax(context.getDestination() and context.getDestinationValue().getTelephoneText() or \'\',\n
context.getDestination() and \\\n
context.getDestinationValue().getDefaultAddressText() or \'\',\n
context.getDestination() and \\\n
context.getDestinationValue().getDefaultAddressRegionTitle() or \'\'),\n
\'destination_telfax\': getPhoneAndFax(context.getDestination() and\n
context.getDestinationValue().getTelephoneText() or \'\',\n
context.getDestination() and context.getDestinationValue().getFaxText() or \'\'),\n
\'destination_email\': getEmail(context.getDestination() and context.getDestinationValue().getEmailText() or \'\'),\n
\'destination_email\': getEmail(context.getDestination() and \\\n
context.getDestinationValue().getEmailText() or \'\'),\n
\n
\'destination_section_title\': context.getDestinationSectionTitle() or \'\',\n
\'destination_section_image_path\': context.getDestinationSectionValue() is not None and context.getDestinationSectionValue().getDefaultImagePath() or \'\',\n
\'destination_section_image_path\': context.getDestinationSectionValue() is not None \\\n
and context.getDestinationSectionValue().getDefaultImagePath() or \'\',\n
\'destination_section_image_width\': context.getDestinationSectionValue() is not None\\\n
and context.getDestinationSectionValue().getDefaultImageWidth() is not None\\\n
and context.getDestinationSectionValue().getDefaultImageWidth() * inch_cm_ratio or \'\',\n
......@@ -257,9 +284,11 @@ data_dict = {\n
context.getDestinationSectionValue().getProperty(\'vat_code\') or \'\'),\n
\n
\'destination_decision_title\': context.getDestinationDecisionTitle() or \'\',\n
\'destination_decision_telfax\': getPhoneAndFax(context.getDestinationDecision() and context.getDestinationDecisionValue().getTelephoneText() or \'\',\n
\'destination_decision_telfax\': getPhoneAndFax(context.getDestinationDecision() and\n
context.getDestinationDecisionValue().getTelephoneText() or \'\',\n
context.getDestinationDecision() and context.getDestinationDecisionValue().getFaxText() or \'\'),\n
\'destination_decision_email\': getEmail(context.getDestinationDecision() and context.getDestinationDecisionValue().getEmailText() or \'\'),\n
\'destination_decision_email\': getEmail(context.getDestinationDecision() and\n
context.getDestinationDecisionValue().getEmailText() or \'\'),\n
\n
\'reference\': context.getReference() or \'\',\n
\'start_date\': getOrderedDate(context.getStartDate()) or \'\',\n
......@@ -270,6 +299,7 @@ data_dict = {\n
\'incoterm\': context.getIncoterm() and context.getIncotermValue().getCodification() or \'\',\n
\n
\'total_price_novat\': total_price,\n
# FIXME: use contentValues\n
\'vat_list\': context.searchFolder(portal_type=context.getPortalTaxMovementTypeList(), order_by=\'title\'),\n
\'description\': getFieldAsLineList(context.getDescription()),\n
\'specialise_title\': context.getProperty(\'specialise_title\',\'\'),\n
......@@ -330,7 +360,7 @@ return unicodeDict(data_dict)\n
<string>getSubLineList</string>
<string>_getattr_</string>
<string>context</string>
<string>T_</string>
<string>translateString</string>
<string>request</string>
<string>getFieldAsLineList</string>
<string>getFieldAsString</string>
......
375
\ No newline at end of file
376
\ No newline at end of file
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