Skip to content

Commit

Permalink
Merge pull request #252 from wasi0013/v0.0.10
Browse files Browse the repository at this point in the history
V0.0.10
  • Loading branch information
wasi0013 committed Nov 3, 2023
2 parents 914fe4e + 531618a commit 7e6db81
Show file tree
Hide file tree
Showing 5 changed files with 111 additions and 6 deletions.
9 changes: 8 additions & 1 deletion HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,11 @@ History
* Added invoice sub command.
* Added invoice manual command to generate manual invoice using prompts.
* Added invoice auto <Project> command to generate invoice from existing projects.
* invoice manual and auto command generates HTML invoices using Tailwind CSS and opens it in a Browser.
* invoice manual and auto command generates HTML invoices using Tailwind CSS and opens it in a Browser.

0.0.10 (2023-11-03)
-------------------

* open invoices using python's standard library.
* code refactor
* bug fix
96 changes: 96 additions & 0 deletions Invoice.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Invoice</title>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/tailwind.min.css" rel="stylesheet">
</head>
<body class="font-sans bg-gray-100">
<div class="container mx-auto py-8">
<div class="bg-white rounded-lg shadow-lg p-8">
<div class="flex justify-between">
<div class="flex items-center">
<img src="/home/wasi/.pytm/invoice-logo.png" width=150 alt="Wasi" class="h-12 mr-4" style="height:auto;">
<div>
<h1 class="text-2xl font-semibold">Wasi</h1>
<p>Chittagong, Bangladesh.</p>
<p>[email protected]</p>
<p>+8801858503621</p>
<p>wasi0013.com</p>
</div>
</div>
<div class="text-right">
<p class="text-sm">Invoice 16</p>
<p class="text-sm">Date: 2023-11-03</p>
<h2 class="font-semibold">Bill to</h2>
<p>Anonymous Client</p>
<p>earth</p>



</div>
</div>
<div class="text-left mb-4">
<h1 class="text-2xl font-semibold">Project: Hello World!</h1>
<p>Date: 2023-11-03</p>
<p>Duration: 02 mins 27 secs</p>
</div>
<div class="mt-4">
<table class="w-full border-collapse border border-gray-300">
<thead>
<tr>
<th class="p-2 border border-gray-300">Task</th>
<th class="p-2 border border-gray-300">Description</th>
<th class="p-2 border border-gray-300">Hours</th>
<th class="p-2 border border-gray-300">Hourly Rate</th>
<th class="p-2 border border-gray-300">Fee</th>
</tr>
</thead>
<tbody>

<tr>
<td class="p-2 border border-gray-300">Todo</td>
<td class="p-2 border border-gray-300">-</td>
<td class="p-2 border border-gray-300">0.38</td>
<td class="p-2 border border-gray-300">75.00$</td>
<td class="p-2 border border-gray-300">28.68</td>
</tr>
<tr>
<td class="p-2 border border-gray-300">Running</td>
<td class="p-2 border border-gray-300">-</td>
<td class="p-2 border border-gray-300">0.03</td>
<td class="p-2 border border-gray-300">75.00$</td>
<td class="p-2 border border-gray-300">1.94</td>
</tr>

</tbody>
</table>
</div>
<div class="mt-4">
<div class="flex justify-end">
<div class="w-1/2">
<table class="w-full">
<tr>
<td class="py-1">Subtotal:</td>
<td class="text-right py-1">30.62$</td>
</tr>
<tr>
<td class="py-1">Discount:</td>
<td class="text-right py-1">0.00$</td>
</tr>
<tr>
<td class="py-1"><strong>Total:</strong></td>
<td class="text-right py-1">30.62$</td>
</tr>
</table>
</div>
</div>
</div>
<div class="mt-4">
<p class="text-left text-sm">Thank you for your business.</p>
</div>
</div>
</div>
</body>
</html>
2 changes: 1 addition & 1 deletion PyTM/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
__author__ = "Wasi"
__email__ = "[email protected]"
__version__ = "0.0.9"
__version__ = "0.0.10"
6 changes: 3 additions & 3 deletions PyTM/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from rich.table import Table
from rich.prompt import Prompt
from rich.prompt import Confirm
import webbrowser
def greet():
"""
shows Greeting Texts
Expand Down Expand Up @@ -233,8 +234,7 @@ def auto(project_name):
with open(html_file, "w") as f:
f.write(html)
console.print(f"The invoice is available in {html_file}")
os.system(f"sensible-browser {html_file}")

webbrowser.open(f"file:///{html_file}", autoraise=True)
@invoice.command()
def manual():
"""
Expand Down Expand Up @@ -293,7 +293,7 @@ def manual():
with open(html_file, "w") as f:
f.write(html)
console.print(f"The invoice is available in {html_file}")
os.system(f"sensible-browser {html_file}")
webbrowser.open(f"file:///{html_file}", autoraise=True)



Expand Down
4 changes: 3 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

setup(
name="python-pytm",
version="0.0.9",
version="0.0.10",
description="PyTM - an Open Source Python Time Management Tool for Mankind",
long_description=readme + "\n\n" + doclink + "\n\n" + history,
long_description_content_type="text/x-rst",
Expand All @@ -32,6 +32,8 @@
url="https://github.com/wasi0013/PyTM",
packages=[
"PyTM",
"PyTM.commands",
"PyTM.core"
],
package_dir={"python-pytm": "PyTM"},
include_package_data=True,
Expand Down

0 comments on commit 7e6db81

Please sign in to comment.