Spaces:
Running
Running
In invoice page add upload file pdf, image, and add scan invoice once scan and upload file pdf and image extract the line item, total
c48ee34
verified
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>Create New Invoice | InvoiceGenius AI</title> | |
| <link rel="stylesheet" href="style.css"> | |
| <script src="https://cdn.tailwindcss.com"></script> | |
| <script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script> | |
| <script src="components/navbar.js"></script> | |
| <script src="components/sidebar.js"></script> | |
| <script src="components/footer.js"></script> | |
| </head> | |
| <body class="bg-gray-50 min-h-screen"> | |
| <custom-navbar></custom-navbar> | |
| <div class="flex"> | |
| <custom-sidebar></custom-sidebar> | |
| <main class="flex-1 p-8"> | |
| <div class="max-w-4xl mx-auto"> | |
| <div class="flex justify-between items-center mb-8"> | |
| <h1 class="text-3xl font-bold text-gray-800">Create New Invoice</h1> | |
| <div class="flex space-x-3"> | |
| <button class="bg-gray-200 hover:bg-gray-300 text-gray-800 px-4 py-2 rounded-lg flex items-center"> | |
| <i data-feather="save" class="mr-2"></i> Save Draft | |
| </button> | |
| <button class="bg-indigo-600 hover:bg-indigo-700 text-white px-4 py-2 rounded-lg flex items-center"> | |
| <i data-feather="send" class="mr-2"></i> Send Invoice | |
| </button> | |
| </div> | |
| </div> | |
| <div class="bg-white rounded-xl shadow-sm border border-gray-100 overflow-hidden mb-8"> | |
| <div class="px-6 py-4 border-b border-gray-100 flex justify-between items-center"> | |
| <h2 class="text-lg font-semibold">Upload Invoice</h2> | |
| <button id="scanBtn" class="text-indigo-600 hover:text-indigo-800 flex items-center"> | |
| <i data-feather="maximize" class="mr-2"></i> Scan Document | |
| </button> | |
| </div> | |
| <div class="p-6"> | |
| <div class="border-2 border-dashed border-gray-300 rounded-lg p-6 text-center"> | |
| <input type="file" id="invoiceUpload" accept=".pdf,.jpg,.jpeg,.png" class="hidden"> | |
| <label for="invoiceUpload" class="cursor-pointer"> | |
| <div class="mx-auto w-16 h-16 bg-indigo-100 rounded-full flex items-center justify-center mb-4"> | |
| <i data-feather="upload" class="w-8 h-8 text-indigo-600"></i> | |
| </div> | |
| <h3 class="text-lg font-medium text-gray-900 mb-1">Drag and drop files here</h3> | |
| <p class="text-sm text-gray-500">or click to browse (PDF, JPG, PNG)</p> | |
| </label> | |
| </div> | |
| <div id="previewContainer" class="mt-6 hidden"> | |
| <h3 class="text-md font-medium text-gray-900 mb-2">Uploaded Files</h3> | |
| <div id="uploadedFiles" class="flex space-x-4"></div> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="bg-white rounded-xl shadow-sm border border-gray-100 overflow-hidden mb-8"> | |
| <div class="px-6 py-4 border-b border-gray-100"> | |
| <h2 class="text-lg font-semibold">Client Information</h2> | |
| </div> | |
| <div class="p-6"> | |
| <div class="grid grid-cols-1 md:grid-cols-2 gap-6"> | |
| <div> | |
| <label class="block text-sm font-medium text-gray-700 mb-1">Client Name</label> | |
| <input type="text" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-indigo-500"> | |
| </div> | |
| <div> | |
| <label class="block text-sm font-medium text-gray-700 mb-1">Email</label> | |
| <input type="email" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-indigo-500"> | |
| </div> | |
| <div> | |
| <label class="block text-sm font-medium text-gray-700 mb-1">Invoice Date</label> | |
| <input type="date" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-indigo-500"> | |
| </div> | |
| <div> | |
| <label class="block text-sm font-medium text-gray-700 mb-1">Due Date</label> | |
| <input type="date" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-indigo-500"> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="bg-white rounded-xl shadow-sm border border-gray-100 overflow-hidden"> | |
| <div class="px-6 py-4 border-b border-gray-100"> | |
| <h2 class="text-lg font-semibold">Invoice Items</h2> | |
| </div> | |
| <div class="p-6"> | |
| <div class="overflow-x-auto"> | |
| <table class="min-w-full divide-y divide-gray-200"> | |
| <thead class="bg-gray-50"> | |
| <tr> | |
| <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Description</th> | |
| <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Quantity</th> | |
| <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Rate</th> | |
| <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Amount</th> | |
| <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"></th> | |
| </tr> | |
| </thead> | |
| <tbody class="bg-white divide-y divide-gray-200"> | |
| <tr> | |
| <td class="px-6 py-4 whitespace-nowrap"> | |
| <input type="text" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-indigo-500"> | |
| </td> | |
| <td class="px-6 py-4 whitespace-nowrap"> | |
| <input type="number" class="w-20 px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-indigo-500" value="1"> | |
| </td> | |
| <td class="px-6 py-4 whitespace-nowrap"> | |
| <input type="number" class="w-24 px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-indigo-500" value="0.00"> | |
| </td> | |
| <td class="px-6 py-4 whitespace-nowrap">$0.00</td> | |
| <td class="px-6 py-4 whitespace-nowrap"> | |
| <button class="text-red-500 hover:text-red-700"> | |
| <i data-feather="trash-2"></i> | |
| </button> | |
| </td> | |
| </tr> | |
| </tbody> | |
| </table> | |
| </div> | |
| <button class="mt-4 text-indigo-600 hover:text-indigo-800 flex items-center"> | |
| <i data-feather="plus" class="mr-2"></i> Add Item | |
| </button> | |
| </div> | |
| </div> | |
| </div> | |
| </main> | |
| </div> | |
| <custom-footer></custom-footer> | |
| <script>feather.replace();</script> | |
| <script src="https://cdn.jsdelivr.net/npm/pdf-lib@1.16.0/dist/pdf-lib.min.js"></script> | |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/tesseract.js/4.1.1/tesseract.min.js"></script> | |
| <script src="script.js"></script> | |
| </body> | |
| </html> |