Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Łukasz Nowak
slapos.core
Commits
3e51cdfd
Commit
3e51cdfd
authored
Feb 08, 2018
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_accounting: Move Printout Form from vifib_hosting
parent
401643fb
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
467 additions
and
0 deletions
+467
-0
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_accounting/SaleInvoiceTransaction_getSlapOSPrintout.css.xml
...counting/SaleInvoiceTransaction_getSlapOSPrintout.css.xml
+62
-0
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_accounting/SaleInvoiceTransaction_getSlapOSPrintout.css.zpt
...counting/SaleInvoiceTransaction_getSlapOSPrintout.css.zpt
+169
-0
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_accounting/SaleInvoiceTransaction_viewSlapOSPrintout.xml
..._accounting/SaleInvoiceTransaction_viewSlapOSPrintout.xml
+64
-0
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_accounting/SaleInvoiceTransaction_viewSlapOSPrintout.zpt
..._accounting/SaleInvoiceTransaction_viewSlapOSPrintout.zpt
+172
-0
No files found.
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_accounting/SaleInvoiceTransaction_getSlapOSPrintout.css.xml
0 → 100644
View file @
3e51cdfd
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"ZopePageTemplate"
module=
"Products.PageTemplates.ZopePageTemplate"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_Cacheable__manager_id
</string>
</key>
<value>
<string>
http_cache
</string>
</value>
</item>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key>
<string>
_asgns
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
name_subpath
</string>
</key>
<value>
<string>
traverse_subpath
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
content_type
</string>
</key>
<value>
<string>
text/html
</string>
</value>
</item>
<item>
<key>
<string>
expand
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
SaleInvoiceTransaction_getSlapOSPrintout.css
</string>
</value>
</item>
<item>
<key>
<string>
output_encoding
</string>
</key>
<value>
<string>
utf-8
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<unicode></unicode>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_accounting/SaleInvoiceTransaction_getSlapOSPrintout.css.zpt
0 → 100644
View file @
3e51cdfd
<tal:block define="dummy python: request.RESPONSE.setHeader('Content-Type', 'text/css;; charset=utf-8')"/>
/* From http://www.jonathantneal.com/examples/invoice/style.css */
/* reset */
*
{
border: 0;
box-sizing: content-box;
color: inherit;
font-family: inherit;
font-size: inherit;
font-style: inherit;
font-weight: inherit;
line-height: inherit;
list-style: none;
margin: 0;
padding: 0;
text-decoration: none;
vertical-align: top;
}
/* heading */
h1 { font: bold 100% sans-serif; letter-spacing: 0.5em; text-align: center; text-transform: uppercase; }
/* table */
/*table { page-break-inside: avoid}*/
/*tr { page-break-inside:avoid ,page-break-after: avoid,page-break-before:avoid}*/
table { font-size: 75%; table-layout: auto; width: 100%; }
table { border-collapse: separate; border-spacing: 0; }
th, td { padding: 0.7em; position: relative; text-align: left; }
th, td { border-style: solid; }
th { background: #EEE; border: 1px solid #DDD; border-bottom: none; border-right: none;}
td { border-left: 1px solid #DDD; border-bottom: 1px solid #DDD}
tr td:last-child {border-right: 1px solid #DDD}
tr th:last-child {border-right: 1px solid #DDD}
table tr:first-child td {border-top: 1px solid #DDD}
/* page */
html { font: 16px/1 'Open Sans', sans-serif; overflow: auto; padding: 0.5in; }
html { background: #999; cursor: default; }
body { box-sizing: border-box; min-height: 11in; margin: 0 auto; overflow: hidden; padding: 0.5in; width: 8.5in; }
body { background: #FFF; border-radius: 1px; box-shadow: 0 0 1in -0.25in rgba(0, 0, 0, 0.5); }
/* header */
header { margin: 0 0 3em; }
header:after { clear: both; content: ""; display: table; }
header h1 { background: #000; border-radius: 0; color: #FFF; margin: 0 0 1em; padding: 0.5em 0; }
header h1.company { background: none; color: #000; text-align: left; padding: 0.5em 0; margin: 0;}
header h1.invoice { background: none; color: #000; text-align: left; padding: 0.5em 0; margin: 0; font-size: 35px; font-weight: bold; letter-spacing: inherit;}
header address { font-size: 75%; font-style: normal; line-height: 1.25; margin: 0 1em 1em 0; }
header address p { margin: 0 0 0.25em; }
header span { display: block; float: right; }
header span { margin: 0 0 1em 1em; max-height: 25%; max-width: 60%; position: relative; }
header img { max-height: 100%; max-width: 100%; display: block;}
header input { cursor: pointer; -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; height: 100%; left: 0; opacity: 0; position: absolute; top: 0; width: 100%; }
header address.left {float: left; }
header address.right {float: right; max-width: 30%;}
/* article */
article, article address, table.meta { margin: 0 0 3em; }
article:after { clear: both; content: ""; display: table; }
/* article h1 { clip: rect(0 0 0 0); position: absolute; } */
article h2:after {
content: ":";
font-size: 1em;
}
article address { float: left; font-size: 120%; }
article h2 { margin-bottom: 10px; }
article address p { margin-bottom: 5px; letter-spacing: 1px;}
/* table meta & balance */
table.meta, table.balance { float: right; width: 40.9%; }
/* table meta */
table.meta th { width: 40%; }
table.meta td { width: 60%; }
table.meta:after, { clear: both; content: ""; display: table; }
/* table items */
table.inventory { clear: both; width: 100%; margin: 0 0 2em; }
table.inventory th { font-weight: bold; text-align: center; }
table.inventory td {padding: 0.97em .7em;}
table.inventory td:nth-child(1) { text-align: left; width: 6%; border-bottom: none}
table.inventory td:nth-child(2) { text-align: left; width: 15%; border-bottom: none}
table.inventory td:nth-child(3) { text-align: left; width: 22%; border-bottom: none }
table.inventory td:nth-child(4) { text-align: right; width: 16%; border-bottom: none }
table.inventory td:nth-child(5) { text-align: left; width: 12%; border-bottom: none }
table.inventory td:nth-child(6) { text-align: right; width: 12%; border-bottom: none}
table.inventory td:nth-child(7) { text-align: right; width: 17%; border-bottom: none}
table.inventory tr:last-child td { border-bottom: 2px solid #DDD}
table.inventory th { border: 2px solid #DDD; border-bottom: none; border-right: none;}
table.inventory td { border-left: 2px solid #DDD; border-bottom: 2px solid #DDD}
table.inventory tr td:last-child {border-right: 2px solid #DDD}
table.inventory tr th:last-child {border-right: 2px solid #DDD}
table.inventory tr:first-child td {border-top: 2px solid #DDD}
/* table balance */
table.balance th { width: 57%; }
table.balance td { width: 40%; }
/*table.balance tr:first-child th, table.balance tr:first-child td { border-top: none; }*/
table.balance td { text-align: right; }
table.balance{ clear: both; }
/* table tax */
table.tax { float: right; clear: both; width: 50%; }
table.tax th { font-weight: bold; text-align: center; }
table.tax td { text-align: right; }
table.tax { margin: 2em 0 2em 0; }
/* table resource */
table.resource td { font-size: 90% }
/* aside */
/* aside h1 { border: none; border-width: 0 0 1px; margin: 0 0 1em; }*/
aside h1 { text-align: left; padding-bottom: 10px;}
aside {margin-top: 20px;}
/* bottom */
footer {
font-size: 0.50em;
width: 100%;
clear: both;
text-align: right;
margin-top: 3em;
}
.line {margin-top: 30px;}
@media print {
* { -webkit-print-color-adjust: exact; }
html { background: none; padding: 0; }
body { box-shadow: none; margin: 0; }
span:empty { display: none; }
.page-break { page-break-before: always; padding-top: 80px; }
tr.page-break td {border-top: 1px solid #DDD}
table.resource tr { page-break-inside:avoid; display:block; position: relative; width: 100%; height: 26px;}
table.resource tr:after { content:''; display:block; clear: both; }
table.resource td, table.resource th { page-break-inside:avoid; overflow: hidden; text-overflow: ellipsis; display: block; float: left; white-space: nowrap;}
table.resource td:nth-child(1) { width: 30px; /* 5% */ }
table.resource td:nth-child(2) { width: 70px; /* 9% */ }
table.resource td:nth-child(3) { width: 178px; /* 25% */ }
table.resource td:nth-child(4) { width: 184px; /* 25% */ }
table.resource td:nth-child(5) { width: 60px; /* 10% */ }
table.resource td:nth-child(6) { width: 99px; /* 12%; */ }
table.resource th:nth-child(1) { width: 29px; }
table.resource th:nth-child(2) { width: 68px; }
table.resource th:nth-child(3) { width: 176px; }
table.resource th:nth-child(4) { width: 182px; }
table.resource th:nth-child(5) { width: 59px; }
table.resource th:nth-child(6) { width: 97px; }
aside h1, table tr th {page-break-inside:avoid; page-break-after: avoid,page-break-before:avoid}
aside.resource {margin-top: 0px;}
.line {margin-top: 0px;}
}
@page { margin: 0; }
\ No newline at end of file
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_accounting/SaleInvoiceTransaction_viewSlapOSPrintout.xml
0 → 100644
View file @
3e51cdfd
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"ZopePageTemplate"
module=
"Products.PageTemplates.ZopePageTemplate"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key>
<string>
_asgns
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
name_subpath
</string>
</key>
<value>
<string>
traverse_subpath
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
_local_properties
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
content_type
</string>
</key>
<value>
<string>
text/html
</string>
</value>
</item>
<item>
<key>
<string>
expand
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
SaleInvoiceTransaction_viewSlapOSPrintout
</string>
</value>
</item>
<item>
<key>
<string>
output_encoding
</string>
</key>
<value>
<string>
utf-8
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<unicode></unicode>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_accounting/SaleInvoiceTransaction_viewSlapOSPrintout.zpt
0 → 100644
View file @
3e51cdfd
<!doctype html>
<html
tal:define=
"quantity_renderer nocall:here/portal_skins/erp5_trade/Base_viewTradeFieldLibrary/my_view_mode_quantity/render_pdf;
price_renderer nocall:here/portal_skins/erp5_trade/Base_viewTradeFieldLibrary/my_view_mode_total_price/render_pdf;
total_not_tax_price_list python: [];
invoice_resource_document python: context.portal_catalog.getResultValue(
portal_type='User Consumption HTML File',
validation_state='shared',
follow_up_uid=context.getUid()
)"
>
<head>
<meta
charset=
"utf-8"
>
<title>
Invoice
</title>
<link
rel=
"stylesheet"
href=
"SaleInvoiceTransaction_getSlapOSPrintout.css"
>
<link
rel=
"license"
href=
"http://www.opensource.org/licenses/mit-license/"
>
</head>
<body>
<header>
<address
class=
"left"
>
<img
alt=
""
src=
"http://www.vifib.com/legal/VIFIB-Legal/vifib_image/LogoVifib-H100.png"
style=
"max-height: 25%; max-width: 70%;"
/>
<h1
class=
"company"
tal:content=
"python: context.getSourceSectionTitle('SlapOS Company')"
></h1>
<tal:block
tal:define=
"source_section_organisation python: context.getSourceSectionValue()"
>
<p
tal:condition=
"python: source_section_organisation is not None"
>
<tal:block
tal:repeat=
"line python: source_section_organisation.getDescription('').split('\n')"
>
<span
style=
"display:block"
tal:content=
"line"
></span>
</tal:block>
</p>
<p
tal:condition=
"python: source_section_organisation is not None"
>
<tal:block
tal:repeat=
"line python: source_section_organisation.getDefaultAddressText('').split('\n')"
>
<span
style=
"display:block"
tal:content=
"line"
></span>
</tal:block>
<tal:block
tal:content=
"python: source_section_organisation.getDefaultRegionTitle()"
></tal:block>
</p>
<p
tal:content=
"python: 'Corporate Registration Code: %s' % source_section_organisation.getCorporateRegistrationCode()"
></p>
<p
tal:content=
"python: 'VAT Code: %s' % source_section_organisation.getVatCode()"
></p>
</tal:block>
</address>
<address
class=
"right"
>
<h1
class=
"invoice"
>
Invoice
</h1>
</address>
<div
style=
"clear:both"
></div>
</header>
<article>
<h2>
To
</h2>
<address>
<p
tal:content=
"python: context.getDestinationSectionTitle('')"
></p>
<tal:block
tal:define=
"destination_section_organisation python: context.getDestinationSectionValue()"
>
<p
tal:condition=
"python: destination_section_organisation is not None"
>
<tal:block
tal:content=
"python: destination_section_organisation.getDefaultEmailText('')"
></tal:block>
</p>
</tal:block>
</address>
<table
class=
"meta"
>
<tr>
<th><span>
Invoice No
</span></th>
<td><span
tal:content=
"python: context.getReference()"
></span></td>
</tr>
<tr>
<th><span>
Date
</span></th>
<td><span
tal:content=
"python: context.getStartDate(DateTime()).strftime('%B %e, %G')"
></span></td>
</tr>
<tr>
<th><span>
Currency
</span></th>
<td><span
tal:content=
"python: context.getPriceCurrencyReference()"
></span></td>
</tr>
</table>
<table
class=
"inventory"
>
<thead>
<tr>
<th><span></span></th>
<th><span>
Item
</span></th>
<th><span>
Description
</span></th>
<th><span>
Quantity
</span></th>
<th><span>
Unit
</span></th>
<th><span>
Unit Price
</span></th>
<th><span>
Total Price
</span></th>
</tr>
</thead>
<tbody>
<tal:block
tal:repeat=
"line python: context.contentValues(portal_type=context.getPortalInvoiceMovementTypeList(),
sort_on=[('int_index', 'ascending'), ('reference', 'ascending')])"
>
<tr
tal:condition=
"python: line.getUse('') != 'trade/tax'"
>
<td><span
tal:content=
"python: line.getReference() or line.getIntIndex()"
></span></td>
<td><span
tal:content=
"python: line.getResourceReference('')"
></span></td>
<td><span
tal:content=
"python: line.getResourceTitle('')"
></span></td>
<td><span
tal:content=
"python: quantity_renderer(round(line.getQuantity(), 3))"
></span></td>
<td><span
tal:content=
"python: line.getQuantityUnitTitle()"
></span></td>
<td><span
tal:content=
"python: price_renderer(line.getPrice())"
></span></td>
<td><span
tal:content=
"python: price_renderer(line.getTotalPrice())"
></span></td>
<tal:block
tal:define=
"dummy python: total_not_tax_price_list.append(line.getTotalPrice())"
></tal:block>
</tr>
</tal:block>
</tbody>
</table>
<table
class=
"balance"
>
<tr>
<th><span>
Total Excluding Tax
</span></th>
<td><span
tal:content=
"python: price_renderer(sum(total_not_tax_price_list))"
></span></td>
</tr>
<tal:block
tal:repeat=
"line python: context.contentValues(portal_type=context.getPortalInvoiceMovementTypeList(),
sort_on=[('int_index', 'ascending'), ('reference', 'ascending')])"
>
<tal:block
tal:condition=
"python: line.getUse('') == 'trade/tax'"
>
<tr>
<th><span>
Tax Rate
</span></th>
<td><span
tal:content=
"python: '%s%%' % quantity_renderer(quantity_renderer(line.getPrice()*100))"
></span></td>
</tr>
<tr>
<th><span>
Tax Price
</span></th>
<td><span
tal:content=
"python: price_renderer(line.getTotalPrice())"
></span></td>
</tr>
</tal:block>
</tal:block>
<tr>
<th><span
style=
"font-weight: bold"
>
Total Including Tax
</span></th>
<td><span
tal:content=
"python: price_renderer(here.getTotalPrice())"
></span></td>
</tr>
</table>
</article>
<!--aside>
<h1><span>Additional Notes</span></h1>
<div>
<p>A finance charge of 1.5% will be made on unpaid balances after 30 days.</p>
</div>
</aside-->
<tal:block
tal:define=
"aggregated_reference python: context.getCausalityReference(portal_type='Sale Packing List', checked_permission='View');
item_dict python: {}"
>
<p
class=
'line'
tal:condition=
"python: aggregated_reference"
>
</p>
<aside
tal:condition=
"python: aggregated_reference"
>
<h1><span>
Subscription Details
</span></h1>
<tal:block
tal:repeat=
"line python: context.portal_catalog(
portal_type='Sale Packing List Line',
grouping_reference=aggregated_reference,
default_resource_uid=context.service_module.slapos_instance_subscription.getUid(),
sort_on=[('default_aggregate_uid', 'ASC'), ('movement.start_date', 'ASC')])"
>
<tal:block
tal:define=
"item_uid python: line.getAggregateUid(portal_type='Hosting Subscription');
item_title python: line.getAggregateTitle(portal_type='Hosting Subscription');
start_date python: line.getStartDate();
stop_date python: line.getStopDate();
quantity python: line.getQuantity();
dummy_init python: item_dict.setdefault(item_uid, [item_title, start_date, stop_date, 0]);
dummy_update python: item_dict.update({item_uid: [item_title,
min(item_dict[item_uid][1], start_date),
max(item_dict[item_uid][2], stop_date),
sum([item_dict[item_uid][3], quantity])]});"
>
</tal:block>
</tal:block>
<table>
<thead>
<tr>
<th><span>
Instance
</span></th>
<th><span>
From
</span></th>
<th><span>
To
</span></th>
<th><span>
Quantity
</span></th>
</tr>
</thead>
<tbody>
<tr
tal:repeat=
"item_tuple python: item_dict.values()"
>
<td
tal:content=
"python: item_tuple[0]"
></td>
<td
tal:content=
"python: item_tuple[1].strftime('%B %e, %G')"
></td>
<td
tal:content=
"python: item_tuple[2].strftime('%B %e, %G')"
></td>
<td
tal:content=
"python: quantity_renderer(item_tuple[3])"
></td>
</tr>
</tbody>
</table>
</aside>
<p
class=
'line page-break'
>
</p>
<tal:block
tal:condition=
"python: invoice_resource_document is not None"
tal:content=
"structure python: invoice_resource_document.getData()"
>
</tal:block>
</tal:block>
<footer>
Generated with ERP5 - Open Source ERP suite (www.erp5.org)
</footer>
</body>
</html>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment