diff --git a/Backend/customer.js b/Backend/customer.js index ec953be..41b4769 100644 --- a/Backend/customer.js +++ b/Backend/customer.js @@ -46,20 +46,21 @@ $(document).ready(async () => { //it waits for html to load }); // Save project data when save button on panel 2 is clicked - $('#saveProject').on('click', function () { + $("#saveProject").click(async () => { projectData = saveProjectData(); - }); - - try { - $('#back_btn').click(async (e) => { + try { + await window.electron.send('createProject', { projectData }); e.preventDefault(); - $('#milestone_table').hide(); - $('#customer_form').show(); - }); - + $('#milestone_table').show(); + $('#customer_form').hide(); + } + catch (error) { + console.log(error); + } + }) + try { const tax = $('#taxes_select').val(); - const tax_options = $('#tax_type_select').val(); if (tax === true) { $('#tax_type').show(); } @@ -72,11 +73,6 @@ $(document).ready(async () => { //it waits for html to load $('#tax_type').hide(); } }); - $('#tax_type_select').change(function () { - const tax_options = $(this).val(); - }) - const table = $("#dataTable"); - let rowDataArray = []; @@ -163,7 +159,6 @@ $(document).ready(async () => { //it waits for html to load $("#create_milestone").click(async () => { try { - //await window.electron.send('createCustomer', { customerData }); await window.electron.send('insertMilestone', { rowDataArray, projectData }); } catch (error) { console.log(error) @@ -173,20 +168,11 @@ $(document).ready(async () => { //it waits for html to load $("#saveCustomer").click(async () => { try { await window.electron.send('createCustomer', { customerData }); - // await window.electron.send('insertmilestone', { rowDataArray }); } catch (error) { console.log(error) } }); - $("#saveProject").click(async () => { - try { - await window.electron.send('createProject', { projectData }); - } - catch(error) { - console.log(error); - } - }) const { company_name } = await window.electron.invoke('fetchCustomer'); $('#customerSelect').empty(); diff --git a/Backend/milestonepage.js b/Backend/milestonepage.js index 2dca925..40430c2 100644 --- a/Backend/milestonepage.js +++ b/Backend/milestonepage.js @@ -17,28 +17,36 @@ $(document).ready(async () => { row.append(`${project ? project.project_name : 'N/A'}`); // Check if project exists row.append(`${milestone.milestone_name}`); row.append(`${invoice ? formatDate(invoice.due_date) : 'N/A'}`); // Update this with the actual due date field - row.append(`${invoice ? formatCurrency(invoice.remaining_amount) : 'N/A'}`); // Remaining Amount); + row.append(`${invoice ? formatCurrency(milestone.amount) : 'N/A'}`); // Remaining Amount); // Status - Use the status from the milestone object const statusCell = $(''); // Create a cell for the status - if (invoice) { + if (invoice && milestone.status !== 'paid') { const payButton = $(' -
@@ -159,6 +125,67 @@

Divine Dashboard

+
+
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+ +
+
+
@@ -171,7 +198,7 @@

Divine Dashboard

-
+
-
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
- -
-
-
diff --git a/public/index.js b/public/index.js index a4a42c6..8bfada1 100644 --- a/public/index.js +++ b/public/index.js @@ -31,7 +31,7 @@ $(document).ready(function () { }); $(document).ready(function () { - $('.next-tab').click(function () { + $('#saveProject').click(function () { var currentTab = $(this).closest('.tabs-panel'); var nextTab = currentTab.next('.tabs-panel'); @@ -42,33 +42,6 @@ $(document).ready(function () { $('a[href="#' + currentTabLink + '"]').parent().removeClass('is-active'); $('a[href="#' + nextTab.attr('id') + '"]').parent().addClass('is-active'); }); - - $('.prev-tab').click(function () { - var currentTab = $(this).closest('.tabs-panel'); - var prevTab = currentTab.prev('.tabs-panel'); - - currentTab.removeClass('is-active'); - prevTab.addClass('is-active'); - - var currentTabLink = currentTab.attr('id'); - $('a[href="#' + currentTabLink + '"]').parent().removeClass('is-active'); - $('a[href="#' + prevTab.attr('id') + '"]').parent().addClass('is-active'); - }); }); -// $(document).ready(function () { -// $('a[href^="#"]').on('click', function (e) { -// e.preventDefault(); - -// var target = this.hash; -// var $target = $(target); - -// $('html, body').stop().animate({ -// 'scrollTop': $target.offset().top -// }, 900, 'swing', function () { -// window.location.hash = target; -// }); -// }); -// }); -