Skip to content

Commit

Permalink
added invoice template to the helm chart
Browse files Browse the repository at this point in the history
  • Loading branch information
deshetti committed Jul 29, 2022
1 parent dc45f03 commit 16c3156
Show file tree
Hide file tree
Showing 5 changed files with 330 additions and 9 deletions.
4 changes: 2 additions & 2 deletions charts/mande/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.3.3
version: 0.4.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
appVersion: 0.6.4
appVersion: 0.14.2

maintainers:
- name: deshetti
Expand Down
299 changes: 299 additions & 0 deletions charts/mande/data/templates/invoice.gohtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,299 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html" charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
<link
href="https://fonts.googleapis.com/css?family=Inter:300,400,500,700"
rel="stylesheet"
type="text/css"
/>
<style type="text/css">
@import url(https://fonts.googleapis.com/css?family=Inter:300,400,500,700);
</style>
<style type="text/css">
th {
text-align: left;
}

@media only screen and (min-width: 480px) {
.mj-column-per-100 {
width: 100% !important;
max-width: 100%;
}

.mj-column-per-33-333333333333336 {
width: 33.333333333333336% !important;
max-width: 33.333333333333336%;
}

.mj-column-per-50 {
width: 50% !important;
max-width: 50%;
}

.mj-column-per-65 {
width: 65% !important;
max-width: 65%;
}

.mj-column-per-35 {
width: 35% !important;
max-width: 35%;
}
}
</style>
<style media="screen and (min-width:480px)">
.moz-text-html .mj-column-per-100 {
width: 100% !important;
max-width: 100%;
}

.moz-text-html .mj-column-per-33-333333333333336 {
width: 33.333333333333336% !important;
max-width: 33.333333333333336%;
}

.moz-text-html .mj-column-per-50 {
width: 50% !important;
max-width: 50%;
}
</style>
<style type="text/css">
@media only screen and (max-width: 480px) {
table.mj-full-width-mobile {
width: 100% !important;
}

td.mj-full-width-mobile {
width: auto !important;
}
}
</style>
<style type="text/css">
*,
*:before,
*:after {
box-sizing: border-box;
margin: 0;
padding: 0;
}

html,
body {
margin: 0;
padding: 0;
word-spacing: normal;
font-size: 14px;
font-family: Inter, sans-serif;
-webkit-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
}

table,
td {
border-collapse: collapse;
mso-table-lspace: 0pt;
mso-table-rspace: 0pt;
}

img {
border: 0;
height: auto;
line-height: 100%;
outline: none;
text-decoration: none;
-ms-interpolation-mode: bicubic;
}

p {
display: block;
margin: 13px 0;
}

.header {
background-color: #9b0046;
padding: 1rem;
margin-bottom: 1rem;
}

.info p {
margin: 0.25rem 0;
}

.content thead {
border-bottom: 2px solid #000;
}

.content thead th {
padding: 16px;
}

.content tbody tr {
border-bottom: 1px solid #000;
}

.content td {
padding: 16px;
}

.content .summary-table tbody {
border-bottom: 1px solid #000;
}

.no-border {
border-bottom: none !important;
}

.footer {
text-align: center;
border-bottom: 2px solid red;
margin-bottom: 2rem;
}
</style>
</head>

<body>
<div>
<div
class="header"
style="padding: 16px; margin: auto; text-align: center"
>
<a href="/" style="color: white; text-decoration: none; display: block">
<img
src="https://storage.googleapis.com/mande.factly.in/logo/datafulLogo.png"
alt=""
style="height: 60px; display: inline-block"
/>
</a>
<a
href="www.dataful.in"
style="color: white; text-decoration: none; display: block"
>www.dataful.in</a
>
</div>
<div class="info">
<div style="max-width: 600px; margin: 0 auto; padding: 1rem">
<table>
<tbody>
<tr>
<td class="mj-column-per-65">
<h2>Invoice</h2>
</td>
<td class="mj-column-per-35">
<img style="height: 24px" src="https://storage.googleapis.com/mande.factly.in/logo/logo.png" alt="" />
</td>
</tr>
<tr>
<td class="mj-column-per-65">
<p><b>INVOICE DATE: </b>{{formatDate .InvoiceDate}}</p>
<p><b>INVOICE NUMBER: </b>{{.InvoiceNumber}}</p>
<p><b>PAYMENT MODE: </b>{{.PaymentMode}}</p>
<p><b>CURRENCY: </b>Indian Rupee</p>
<p><b>HSN: </b>998399</p>
{{if .GSTIN}}
<p><b>GSTIN: </b>{{.GSTIN}}</p>
{{end}}

<p></p>
</td>

<td class="mj-column-per-35">
<p>
<b>Address:</b> <br />
<b>FACTLY MEDIA & RESEARCH</b> <br />

103, Divya Apartments,<br />8-3-973/2, Srinagar <br />
Colony, Hyderabad <br />
Telangana -500073 India <br />
<b>PAN: </b> AAEFF5447J <br />
<b>GST ID: </b> 36AAEFF5447J1Z8 <br />
www.factly.in
</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="content" style="background-color: #f2f2f2">
<div style="max-width: 600px; margin: 0 auto; padding: 1rem">
<p><b> ACCOUNT NAME:</b>{{.UserName}}</p>
<p><b> BILLING ADDRESS:</b></p>
<p>{{.Address}}</p>
<table style="width: 100%">
<thead>
<tr>
<th>Purchases</th>
<th>Validity</th>
<th>Amount</th>
</tr>
</thead>
<tbody>
<tr>
<td style="color: #9b0046"><b>{{.PlanName}}</b></td>
<td>{{formatDate .StartDate}} – {{formatDate .EndDate}}</td>
<td>₹ {{.BaseAmount}}</td>
</tr>
{{if checkExtraLicenses .ExtraLicenses}}
<tr>
<td>
Extra Licenses <br />
(Quantity - {{.ExtraLicenses}}) <br />
(Cost – {{.ExtraLicenses}} x {{.ExtraLicensePrice}})
</td>
<td>{{formatDate .StartDate}} – {{formatDate .EndDate}}</td>
<td>₹ {{.ExtraLicenseAmount}}</td>
</tr>
{{end}}
<tr class="no-border">
<td colspan="3" style="padding: 16px 0">
<div style="margin-left: auto" class="mj-column-per-50">
<table class="summary-table" style="width: 100%">
<tbody>
<tr class="no-border">
<td><b>Subtotal:</b></td>
<td>₹ {{.SubTotal}}</td>
</tr>
<tr class="no-border">
<td><b>GST: ({{ if .IsIGST}}{{"IGST"}} {{else}} {{"CGST + SGST"}} {{end}})</b></td>
<td>₹ {{.TaxAmount}}</td>
</tr>
</tbody>
<tbody>
<tr class="no-border">
<td><b>Total:</b></td>
<td>₹ {{.Total}}</td>
</tr>
</tbody>
<tbody class="no-border">
<tr class="no-border">
<td style="color: #9b0046"><b>AMOUNT PAID:</b></td>
<td>₹ {{.Total}}</td>
</tr>
</tbody>
</table>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="footer">
<p>
<b>For support:</b> Please contact us at
<a href="mailto:[email protected]">[email protected]</a>
</p>
<p>
<b>Terms and Conditions</b> can be read at
<a href="www.dataful.in/terms-and-conditions"
>www.dataful.in/terms-and-conditions</a
>
</p>
</div>
</div>
</body>
</html>
15 changes: 15 additions & 0 deletions charts/mande/templates/server/configmaps/configmap-invoice.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: mande-invoice-template
namespace: {{ template "mande.namespace" . }}
labels:
{{- include "server.labels" . | nindent 4 }}
{{- if .Values.server.configAnnotations }}
annotations:
{{- range $key, $value := .Values.server.configAnnotations }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
data:
{{- (.Files.Glob "data/templates/**.gohtml").AsConfig | nindent 2 }}
19 changes: 13 additions & 6 deletions charts/mande/templates/server/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ spec:
{{- end }}
resources:
{{- toYaml .Values.server.resources | nindent 12 }}
# volumeMounts:
# - name: dega-server-data
# mountPath: ./data
volumeMounts:
- name: mande-invoice-template
mountPath: ./templates
{{- end }}
{{- if .Values.server.createSuperOrg}}
- name: {{ .Values.server.name }}-create-super-org
Expand All @@ -65,9 +65,9 @@ spec:
{{- end }}
resources:
{{- toYaml .Values.server.resources | nindent 12 }}
# volumeMounts:
# - name: dega-server-data
# mountPath: ./data
volumeMounts:
- name: mande-invoice-template
mountPath: ./templates
{{- end }}
{{- end }}
containers:
Expand Down Expand Up @@ -112,6 +112,13 @@ spec:
failureThreshold: {{ .Values.server.readinessProbe.failureThreshold }}
resources:
{{- toYaml .Values.server.resources | nindent 12 }}
volumeMounts:
- name: mande-invoice-template
mountPath: ./templates
volumes:
- name: mande-invoice-template
configMap:
name: mande-invoice-template
{{- with .Values.server.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
Expand Down
2 changes: 1 addition & 1 deletion charts/mande/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ server:
image:
repository: factly/mande-server
pullPolicy: IfNotPresent
tag: "0.1.0"
tag: ""

# imagePullSecrets: []

Expand Down

0 comments on commit 16c3156

Please sign in to comment.