{"id":25117874,"url":"https://github.com/mateuszcalderon/receipt","last_synced_at":"2025-04-02T12:29:38.104Z","repository":{"id":228479588,"uuid":"773807684","full_name":"mateuszcalderon/receipt","owner":"mateuszcalderon","description":"An easy receipt code made with Python to improve my programming skills.","archived":false,"fork":false,"pushed_at":"2025-01-29T01:20:27.000Z","size":10,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-08T03:34:43.682Z","etag":null,"topics":["programming","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mateuszcalderon.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-03-18T12:42:30.000Z","updated_at":"2025-01-29T01:20:30.000Z","dependencies_parsed_at":"2024-03-19T01:44:31.521Z","dependency_job_id":"d64f0f3e-1b69-4ba1-8381-6d6e293adbdd","html_url":"https://github.com/mateuszcalderon/receipt","commit_stats":null,"previous_names":["mateuszjoestar/receipt","mateuszcalderon/receipt"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mateuszcalderon%2Freceipt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mateuszcalderon%2Freceipt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mateuszcalderon%2Freceipt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mateuszcalderon%2Freceipt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mateuszcalderon","download_url":"https://codeload.github.com/mateuszcalderon/receipt/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246814899,"owners_count":20838344,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["programming","python"],"created_at":"2025-02-08T03:34:56.370Z","updated_at":"2025-04-02T12:29:38.097Z","avatar_url":"https://github.com/mateuszcalderon.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/devicons/devicon/blob/master/icons/python/python-original.svg\" height=\"60\" width=\"60\"\u003e\n\u003c/p\u003e\n\n\u003cdiv align=\"center\"\u003e\n  \u003ch1\u003eReceipt\u003c/h1\u003e\n\u003c/div\u003e\n\nThis is my very first Python project where I created a simple receipt generator that calculates the total cost for a product purchase, including tax. The program prompts the user for the product's price, name, and quantity, then displays a neatly formatted receipt with the current date and time.\n\n#### Key Features:\n  - **Real-time Date and Time:** The receipt displays the current date and time, formatted to resemble an actual receipt.\n  - **Tax Calculation:** The program calculates a 7.125% tax on the subtotal and displays the tax amount separately.\n  - **Formatted Output:** The receipt is formatted to look professional, showing the product, quantity, subtotal, tax, and total with proper decimal precision.\n  - **User Input:** The user can input the product's price, name, and quantity, and the program will calculate the total cost.\n\n## Code Walkthrough:\n#### Library:\n```python\n  import datetime\n```\n\n  - ` datetime `: Used to fetch the current date and time.\n\n#### Collecting User Input:\n```python\n  product_price = float(input(\"PRICE: \"))\n  product_name = input(\"PRODUCT: \")\n  quantity = int(input(\"QTY: \"))\n```\n\n  - The user is prompted to enter the product's price, name, and quantity. The price is converted to float, and the quantity is converted to integer.\n\n#### Displaying the Receipt:\n```python\n  print(\"---------------------------\")\n  print(\"          RECEIPT          \")\n  print(current_time.strftime(\"%m/%d/%Y.........%H:%M:%S\"))\n  print(f\"PRODUCT   : {product_name.upper()}\")\n  print(f\"QTY       : {quantity}\")\n```\n\n  - The program prints the formatted receipt header and uses ` strftime ` to display the current date and time in a receipt-like format. The product name is also converted to uppercase to enhance the receipt’s appearance.\n\n#### Calculating the Subtotal, Tax, and Total:\n```python\n  sub_total = product_price * quantity\n  tax = 7.125 / 100 * sub_total\n  total = tax + sub_total\n```\n\n  - The program calculates the subtotal, tax amount, and total cost by applying a 7.125% tax rate to the subtotal.\n\n#### Final Output:\n```python\n  print(f\"SUB TOTAL : {sub_total:.2f}\")\n  print(f\"TAX AMOUNT: ${tax:.2f}\")\n  print(f\"TOTAL     : ${total:.2f}\")\n  print(\"---------------------------\")\n```\n\n  - The receipt is displayed with the product details, calculated subtotal, tax amount, and total. All amounts are formatted to two decimal places for clarity.\n\n## Development Environment:\nTo develop this project, I used the online IDE [OnlineGDB.com](https://www.onlinegdb.com/online_python_compiler), which offers an easy-to-use compiler and debugger for Python.\n\n## Contact:\nFeel free to reach out to me with any questions, suggestions, or feedback!\u003cbr/\u003e\n[![GitHub](https://github.com/CLorant/readme-social-icons/blob/main/large/filled/github.svg)](https://github.com/mateuszcalderon)\n[![Instagram](https://github.com/CLorant/readme-social-icons/blob/main/large/filled/instagram.svg)](https://www.instagram.com/mateuszcalderon/)\n[![LinkedIn](https://github.com/CLorant/readme-social-icons/blob/main/large/filled/linkedin.svg)](https://www.linkedin.com/in/mateuszcalderonreis/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmateuszcalderon%2Freceipt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmateuszcalderon%2Freceipt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmateuszcalderon%2Freceipt/lists"}