Commit 714520cf authored by Xiaowu Zhang's avatar Xiaowu Zhang

Corporate identity letter improvement

See merge request nexedi/erp5!1241
parents 6b12e2b2 35d88eb1
Pipeline #10983 failed with stage
...@@ -114,8 +114,8 @@ def populateOrganisationDict(my_organisation_list): ...@@ -114,8 +114,8 @@ def populateOrganisationDict(my_organisation_list):
organisation_region = organisation.getRegionValue() organisation_region = organisation.getRegionValue()
organisation_phone = organisation.getDefaultTelephoneValue() organisation_phone = organisation.getDefaultTelephoneValue()
organisation_fax = organisation.getDefaultFax() organisation_fax = organisation.getDefaultFax()
organisation_link_list = organisation.objectValues(portal_type="Link",title="Corporate Web Site") organisation_link_list = [x for x in organisation.objectValues(portal_type="Link") if x.getTitle()=="Corporate Web Site"]
organisation_bank_list = organisation.objectValues(portal_type="Bank Account",title="Default Bank Account") organisation_bank_list = [x for x in organisation.objectValues(portal_type="Bank Account") if x.getValidationState()=='validated' and x.getTitle()=="Default Bank Account"]
organisation_default_image = organisation.getDefaultImage() organisation_default_image = organisation.getDefaultImage()
output_dict["organisation_title"] = organisation.getTitle() output_dict["organisation_title"] = organisation.getTitle()
...@@ -235,11 +235,13 @@ if pass_parameter is not None and pass_source_data is not None: ...@@ -235,11 +235,13 @@ if pass_parameter is not None and pass_source_data is not None:
# XXX remove, too much ambiguity if multiple results # XXX remove, too much ambiguity if multiple results
# returns [{organisation_dict}] # returns [{organisation_dict}]
if pass_parameter == "override_organisation": if pass_parameter == "override_organisation":
return populateOrganisationDict(portal_object.portal_catalog( organisation_list = portal_object.portal_catalog(
portal_type="Organisation", portal_type="Organisation",
#title=(''.join(["=", str(pass_source_data)])) #title=(''.join(["=", str(pass_source_data)]))
title=pass_source_data title=pass_source_data,
)) )
organisation_list = [x for x in organisation_list if x.getTitle()==pass_source_data]
return populateOrganisationDict(organisation_list)
# ------------ Override Sender/Recipient Organisation (URL) -------------------- # ------------ Override Sender/Recipient Organisation (URL) --------------------
# returns [{organisation_dict}] # returns [{organisation_dict}]
......
...@@ -77,7 +77,9 @@ Generates the letter Content ...@@ -77,7 +77,9 @@ Generates the letter Content
<td class="ci-letter-destination"> <td class="ci-letter-destination">
<span tal:content="python: letter_destination_company or ' '"></span> <span tal:content="python: letter_destination_company or ' '"></span>
<span tal:content="python: letter_destination_person or ' '"></span> <span tal:content="python: letter_destination_person or ' '"></span>
<span tal:content="python: letter_destination_address or ' '"></span> <tal:block tal:repeat="address python: letter_destination_address.split('\n')">
<span tal:content="python: address"></span>
</tal:block>
<span tal:content="python: ''.join([letter_destination_postal_code, ' ', letter_destination_city])"></span> <span tal:content="python: ''.join([letter_destination_postal_code, ' ', letter_destination_city])"></span>
<span tal:content="python: letter_destination_country or ' '"></span> <span tal:content="python: letter_destination_country or ' '"></span>
</td> </td>
......
...@@ -99,26 +99,46 @@ Creates the Letter footer section. ...@@ -99,26 +99,46 @@ Creates the Letter footer section.
<td> <td>
<div> <div>
<span class="ci-letter-footer-title" i18n:translate="" i18n:domain="erp5_ui">Address</span><span tal:content="letter_source_company"></span> <span class="ci-letter-footer-title" i18n:translate="" i18n:domain="erp5_ui">Address</span><span tal:content="letter_source_company"></span>
<span class="ci-letter-footer-title">&nbsp;</span><span tal:content="letter_source_address"></span> <tal:block tal:repeat="address python: letter_source_address.split('\n')">
<span class="ci-letter-footer-title">&nbsp;</span><span tal:content="address"></span>
</tal:block>
<span class="ci-letter-footer-title">&nbsp;</span><span tal:content="python: ''.join([letter_source_postal_code, ' ', letter_source_city])"></span> <span class="ci-letter-footer-title">&nbsp;</span><span tal:content="python: ''.join([letter_source_postal_code, ' ', letter_source_city])"></span>
<span class="ci-letter-footer-title">&nbsp;</span><span tal:content="letter_source_country"></span> <span class="ci-letter-footer-title">&nbsp;</span><span tal:content="letter_source_country"></span>
</div> </div>
</td> </td>
<td> <td>
<div> <div>
<span class="ci-letter-footer-title" i18n:translate="" i18n:domain="erp5_ui">Telephone</span><span tal:content="letter_source_phone"></span> <tal:block tal:condition=letter_source_phone>
<span class="ci-letter-footer-title" i18n:translate="" i18n:domain="erp5_ui">Telefax</span><span tal:content="letter_source_fax"></span> <span class="ci-letter-footer-title" i18n:translate="" i18n:domain="erp5_ui">Telephone</span><span tal:content="letter_source_phone"></span>
<span class="ci-letter-footer-title" i18n:translate="" i18n:domain="erp5_ui">Email</span><span tal:content="letter_source_mail"></span> </tal:block>
<span class="ci-letter-footer-title" i18n:translate="" i18n:domain="erp5_ui">Web Address</span><span tal:content="letter_source_website"></span> <tal:block tal:condition=letter_source_fax>
<span class="ci-letter-footer-title" i18n:translate="" i18n:domain="erp5_ui">Telefax</span><span tal:content="letter_source_fax"></span>
</tal:block>
<tal:block tal:condition=letter_source_mail>
<span class="ci-letter-footer-title" i18n:translate="" i18n:domain="erp5_ui">Email</span><span tal:content="letter_source_mail"></span>
</tal:block>
<tal:block tal:condition=letter_source_website>
<span class="ci-letter-footer-title" i18n:translate="" i18n:domain="erp5_ui">Web Address</span><span tal:content="letter_source_website"></span>
</tal:block>
</div> </div>
</td> </td>
<td> <td>
<div> <div>
<span class="ci-letter-footer-title" i18n:translate="" i18n:domain="erp5_ui">Bank Account</span><span tal:content="letter_source_bank"></span> <tal:block tal:condition=letter_source_bank>
<span class="ci-letter-footer-title" i18n:translate="" i18n:domain="erp5_ui">BIC</span><span tal:content="letter_source_bic"></span> <span class="ci-letter-footer-title" i18n:translate="" i18n:domain="erp5_ui">Bank Account</span><span tal:content="letter_source_bank"></span>
<span class="ci-letter-footer-title"i18n:translate="" i18n:domain="erp5_ui">IBAN</span><span tal:content="letter_source_iban"></span> </tal:block>
<span class="ci-letter-footer-title" i18n:translate="" i18n:domain="erp5_ui">VAT ID</span><span tal:content="letter_source_vat"></span> <tal:block tal:condition=letter_source_bic>
<span class="ci-letter-footer-title" i18n:translate="" i18n:domain="erp5_ui">Siren</span><span tal:content="letter_source_corporate_registration"></span> <span class="ci-letter-footer-title" i18n:translate="" i18n:domain="erp5_ui">BIC</span><span tal:content="letter_source_bic"></span>
</tal:block>
<tal:block tal:condition=letter_source_iban>
<span class="ci-letter-footer-title"i18n:translate="" i18n:domain="erp5_ui">IBAN</span><span tal:content="letter_source_iban"></span>
</tal:block>
<tal:block tal:condition=letter_source_vat>
<span class="ci-letter-footer-title" i18n:translate="" i18n:domain="erp5_ui">VAT ID</span><span tal:content="letter_source_vat"></span>
</tal:block>
<tal:block tal:condition=letter_source_corporate_registration>
<span class="ci-letter-footer-title" i18n:translate="" i18n:domain="erp5_ui">Siren</span><span tal:content="letter_source_corporate_registration"></span>
</tal:block>
</div> </div>
</td> </td>
</tr> </tr>
......
...@@ -79,7 +79,7 @@ ...@@ -79,7 +79,7 @@
</item> </item>
<item> <item>
<key> <string>content_md5</string> </key> <key> <string>content_md5</string> </key>
<value> <string>b913ec7475eea77fbefb35c036cebbbe</string> </value> <value> <string>1aacfe1cfff70755cc2f3e988332db7c</string> </value>
</item> </item>
<item> <item>
<key> <string>content_type</string> </key> <key> <string>content_type</string> </key>
......
...@@ -79,7 +79,7 @@ ...@@ -79,7 +79,7 @@
</item> </item>
<item> <item>
<key> <string>content_md5</string> </key> <key> <string>content_md5</string> </key>
<value> <string>5f80228e63ac26e2586e4cc78468bc17</string> </value> <value> <string>9be2c8998cea169b7b35507a691eed78</string> </value>
</item> </item>
<item> <item>
<key> <string>content_type</string> </key> <key> <string>content_type</string> </key>
......
...@@ -85,7 +85,7 @@ ...@@ -85,7 +85,7 @@
</item> </item>
<item> <item>
<key> <string>content_md5</string> </key> <key> <string>content_md5</string> </key>
<value> <string>1aafde18d3f372c35d8e3cfe51d2319e</string> </value> <value> <string>af8c984d2520e5c379aee689f66d82d0</string> </value>
</item> </item>
<item> <item>
<key> <string>content_type</string> </key> <key> <string>content_type</string> </key>
......
...@@ -79,7 +79,7 @@ ...@@ -79,7 +79,7 @@
</item> </item>
<item> <item>
<key> <string>content_md5</string> </key> <key> <string>content_md5</string> </key>
<value> <string>aa56c9f7299d735b06905653c793d36b</string> </value> <value> <string>17474188ff337647569975437df08087</string> </value>
</item> </item>
<item> <item>
<key> <string>content_type</string> </key> <key> <string>content_type</string> </key>
......
...@@ -79,7 +79,7 @@ ...@@ -79,7 +79,7 @@
</item> </item>
<item> <item>
<key> <string>content_md5</string> </key> <key> <string>content_md5</string> </key>
<value> <string>06fa5da6d1f0a78902331664e1303cb2</string> </value> <value> <string>62679175c398299994c9d63f36e77d94</string> </value>
</item> </item>
<item> <item>
<key> <string>content_type</string> </key> <key> <string>content_type</string> </key>
......
...@@ -79,7 +79,7 @@ ...@@ -79,7 +79,7 @@
</item> </item>
<item> <item>
<key> <string>content_md5</string> </key> <key> <string>content_md5</string> </key>
<value> <string>83ef45d6c99d6276850e7cf404671d8d</string> </value> <value> <string>83909489a9a5f2ac67e608f2f0980bc1</string> </value>
</item> </item>
<item> <item>
<key> <string>content_type</string> </key> <key> <string>content_type</string> </key>
......
...@@ -203,6 +203,11 @@ Note: ...@@ -203,6 +203,11 @@ Note:
</tr> </tr>
<tr> <tr>
<td>waitForElementPresent</td> <td>waitForElementPresent</td>
<td>//span[contains(text(), 'Address')]</td>
<td></td>
</tr>
<tr>
<td>verifyElementNotPresent</td>
<td>//span[contains(text(), 'IBAN')]</td> <td>//span[contains(text(), 'IBAN')]</td>
<td></td> <td></td>
</tr> </tr>
...@@ -460,6 +465,11 @@ Note: ...@@ -460,6 +465,11 @@ Note:
</tr> </tr>
<tr> <tr>
<td>waitForElementPresent</td> <td>waitForElementPresent</td>
<td>//span[contains(text(), 'Address')]</td>
<td></td>
</tr>
<tr>
<td>verifyElementNotPresent</td>
<td>//span[contains(text(), 'IBAN')]</td> <td>//span[contains(text(), 'IBAN')]</td>
<td></td> <td></td>
</tr> </tr>
...@@ -762,6 +772,11 @@ Note: ...@@ -762,6 +772,11 @@ Note:
</tr> </tr>
<tr> <tr>
<td>waitForElementPresent</td> <td>waitForElementPresent</td>
<td>//span[contains(text(), 'Address')]</td>
<td></td>
</tr>
<tr>
<td>verifyElementNotPresent</td>
<td>//span[contains(text(), 'IBAN')]</td> <td>//span[contains(text(), 'IBAN')]</td>
<td></td> <td></td>
</tr> </tr>
...@@ -1029,6 +1044,11 @@ Note: ...@@ -1029,6 +1044,11 @@ Note:
</tr> </tr>
<tr> <tr>
<td>waitForElementPresent</td> <td>waitForElementPresent</td>
<td>//span[contains(text(), 'Address')]</td>
<td></td>
</tr>
<tr>
<td>verifyElementNotPresent</td>
<td>//span[contains(text(), 'IBAN')]</td> <td>//span[contains(text(), 'IBAN')]</td>
<td></td> <td></td>
</tr> </tr>
......
...@@ -60,7 +60,9 @@ ...@@ -60,7 +60,9 @@
<td class="ci-letter-destination"> <td class="ci-letter-destination">
<span> </span> <span> </span>
<span> </span> <span> </span>
<span> </span>
<span></span>
<span> </span> <span> </span>
<span> </span> <span> </span>
</td> </td>
...@@ -128,26 +130,28 @@ Feel free to call me back in case you have further questions (01-23-456789-0). ...@@ -128,26 +130,28 @@ Feel free to call me back in case you have further questions (01-23-456789-0).
<td> <td>
<div> <div>
<span class="ci-letter-footer-title">Address</span><span></span> <span class="ci-letter-footer-title">Address</span><span></span>
<span class="ci-letter-footer-title">&nbsp;</span><span></span>
<span class="ci-letter-footer-title">&nbsp;</span><span></span>
<span class="ci-letter-footer-title">&nbsp;</span><span> </span> <span class="ci-letter-footer-title">&nbsp;</span><span> </span>
<span class="ci-letter-footer-title">&nbsp;</span><span></span> <span class="ci-letter-footer-title">&nbsp;</span><span></span>
</div> </div>
</td> </td>
<td> <td>
<div> <div>
<span class="ci-letter-footer-title">Telephone</span><span></span>
<span class="ci-letter-footer-title">Telefax</span><span></span>
<span class="ci-letter-footer-title">Email</span><span></span>
<span class="ci-letter-footer-title">Web Address</span><span></span>
</div> </div>
</td> </td>
<td> <td>
<div> <div>
<span class="ci-letter-footer-title">Bank Account</span><span></span>
<span class="ci-letter-footer-title">BIC</span><span></span>
<span class="ci-letter-footer-title">IBAN</span><span></span>
<span class="ci-letter-footer-title">VAT ID</span><span></span>
<span class="ci-letter-footer-title">Siren</span><span></span>
</div> </div>
</td> </td>
</tr> </tr>
......
...@@ -60,7 +60,9 @@ ...@@ -60,7 +60,9 @@
<td class="ci-letter-destination"> <td class="ci-letter-destination">
<span>Test Organisation</span> <span>Test Organisation</span>
<span>Test Recipient</span> <span>Test Recipient</span>
<span>Test Drive 123</span>
<span>Test Drive 123</span>
<span>12345 Test City</span> <span>12345 Test City</span>
<span> </span> <span> </span>
</td> </td>
...@@ -128,26 +130,32 @@ Feel free to call me back in case you have further questions (01-23-456789-0). ...@@ -128,26 +130,32 @@ Feel free to call me back in case you have further questions (01-23-456789-0).
<td> <td>
<div> <div>
<span class="ci-letter-footer-title">Address</span><span>Test Organisation</span> <span class="ci-letter-footer-title">Address</span><span>Test Organisation</span>
<span class="ci-letter-footer-title">&nbsp;</span><span>Test Drive 123</span>
<span class="ci-letter-footer-title">&nbsp;</span><span>Test Drive 123</span>
<span class="ci-letter-footer-title">&nbsp;</span><span>12345 Test City</span> <span class="ci-letter-footer-title">&nbsp;</span><span>12345 Test City</span>
<span class="ci-letter-footer-title">&nbsp;</span><span></span> <span class="ci-letter-footer-title">&nbsp;</span><span></span>
</div> </div>
</td> </td>
<td> <td>
<div> <div>
<span class="ci-letter-footer-title">Telephone</span><span>+123 456 789 0</span>
<span class="ci-letter-footer-title">Telefax</span><span></span> <span class="ci-letter-footer-title">Telephone</span><span>+123 456 789 0</span>
<span class="ci-letter-footer-title">Email</span><span>info@test-organisation.eu</span>
<span class="ci-letter-footer-title">Web Address</span><span></span>
<span class="ci-letter-footer-title">Email</span><span>info@test-organisation.eu</span>
</div> </div>
</td> </td>
<td> <td>
<div> <div>
<span class="ci-letter-footer-title">Bank Account</span><span>Template Test Bank Account</span>
<span class="ci-letter-footer-title">BIC</span><span></span>
<span class="ci-letter-footer-title">IBAN</span><span></span>
<span class="ci-letter-footer-title">VAT ID</span><span></span>
<span class="ci-letter-footer-title">Siren</span><span></span>
</div> </div>
</td> </td>
</tr> </tr>
......
...@@ -60,7 +60,9 @@ ...@@ -60,7 +60,9 @@
<td class="ci-letter-destination"> <td class="ci-letter-destination">
<span>Test Association</span> <span>Test Association</span>
<span>Test Association Member</span> <span>Test Association Member</span>
<span>Foss Street 101</span>
<span>Foss Street 101</span>
<span>98765 Libertyville</span> <span>98765 Libertyville</span>
<span> </span> <span> </span>
</td> </td>
...@@ -128,26 +130,32 @@ Feel free to call me back in case you have further questions (01-23-456789-0). ...@@ -128,26 +130,32 @@ Feel free to call me back in case you have further questions (01-23-456789-0).
<td> <td>
<div> <div>
<span class="ci-letter-footer-title">Address</span><span>Test Association</span> <span class="ci-letter-footer-title">Address</span><span>Test Association</span>
<span class="ci-letter-footer-title">&nbsp;</span><span>Foss Street 101</span>
<span class="ci-letter-footer-title">&nbsp;</span><span>Foss Street 101</span>
<span class="ci-letter-footer-title">&nbsp;</span><span>98765 Libertyville</span> <span class="ci-letter-footer-title">&nbsp;</span><span>98765 Libertyville</span>
<span class="ci-letter-footer-title">&nbsp;</span><span></span> <span class="ci-letter-footer-title">&nbsp;</span><span></span>
</div> </div>
</td> </td>
<td> <td>
<div> <div>
<span class="ci-letter-footer-title">Telephone</span><span>+190 123 123</span>
<span class="ci-letter-footer-title">Telefax</span><span></span> <span class="ci-letter-footer-title">Telephone</span><span>+190 123 123</span>
<span class="ci-letter-footer-title">Email</span><span>info@test-assosication.eu</span>
<span class="ci-letter-footer-title">Web Address</span><span></span>
<span class="ci-letter-footer-title">Email</span><span>info@test-assosication.eu</span>
</div> </div>
</td> </td>
<td> <td>
<div> <div>
<span class="ci-letter-footer-title">Bank Account</span><span></span>
<span class="ci-letter-footer-title">BIC</span><span></span>
<span class="ci-letter-footer-title">IBAN</span><span></span>
<span class="ci-letter-footer-title">VAT ID</span><span></span>
<span class="ci-letter-footer-title">Siren</span><span></span>
</div> </div>
</td> </td>
</tr> </tr>
......
...@@ -60,7 +60,9 @@ ...@@ -60,7 +60,9 @@
<td class="ci-letter-destination"> <td class="ci-letter-destination">
<span>Test Organisation</span> <span>Test Organisation</span>
<span>Test Recipient</span> <span>Test Recipient</span>
<span>Test Drive 123</span>
<span>Test Drive 123</span>
<span>12345 Test City</span> <span>12345 Test City</span>
<span> </span> <span> </span>
</td> </td>
...@@ -178,26 +180,32 @@ mi aliquet a praesent ante orci accumsan magna neque. ...@@ -178,26 +180,32 @@ mi aliquet a praesent ante orci accumsan magna neque.
<td> <td>
<div> <div>
<span class="ci-letter-footer-title">Address</span><span>Test Organisation</span> <span class="ci-letter-footer-title">Address</span><span>Test Organisation</span>
<span class="ci-letter-footer-title">&nbsp;</span><span>Test Drive 123</span>
<span class="ci-letter-footer-title">&nbsp;</span><span>Test Drive 123</span>
<span class="ci-letter-footer-title">&nbsp;</span><span>12345 Test City</span> <span class="ci-letter-footer-title">&nbsp;</span><span>12345 Test City</span>
<span class="ci-letter-footer-title">&nbsp;</span><span></span> <span class="ci-letter-footer-title">&nbsp;</span><span></span>
</div> </div>
</td> </td>
<td> <td>
<div> <div>
<span class="ci-letter-footer-title">Telephone</span><span>+123 456 789 0</span>
<span class="ci-letter-footer-title">Telefax</span><span></span> <span class="ci-letter-footer-title">Telephone</span><span>+123 456 789 0</span>
<span class="ci-letter-footer-title">Email</span><span>info@test-organisation.eu</span>
<span class="ci-letter-footer-title">Web Address</span><span></span>
<span class="ci-letter-footer-title">Email</span><span>info@test-organisation.eu</span>
</div> </div>
</td> </td>
<td> <td>
<div> <div>
<span class="ci-letter-footer-title">Bank Account</span><span>Template Test Bank Account</span>
<span class="ci-letter-footer-title">BIC</span><span></span>
<span class="ci-letter-footer-title">IBAN</span><span></span>
<span class="ci-letter-footer-title">USt-ID</span><span></span>
<span class="ci-letter-footer-title">Siren</span><span></span>
</div> </div>
</td> </td>
</tr> </tr>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__name__</string> </key>
<value> <string>Heuristica-BoldItalic.otf</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>application/octet-stream</string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -31,3 +31,10 @@ with Reserved Font Name Heuristica. ...@@ -31,3 +31,10 @@ with Reserved Font Name Heuristica.
font-weight: bold; font-weight: bold;
font-style: normal; font-style: normal;
} }
@font-face {
font-family: 'Heuristica';
src: url('heuristica/Heuristica-BoldItalic.otf') format('truetype');
font-weight: bold;
font-style: italic;
}
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