From 4ced7076355171f485b1c59a4ad1a4d854c4c751 Mon Sep 17 00:00:00 2001 From: Nicolas Bally Date: Thu, 12 Sep 2019 10:35:51 +0200 Subject: [PATCH] suite --- .../_p_customer_sheet.html.haml | 38 ++++++++++--------- .../admin/p_documents/send_by_mail.html.haml | 6 +-- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/app/views/admin/p_customer_sheets/_p_customer_sheet.html.haml b/app/views/admin/p_customer_sheets/_p_customer_sheet.html.haml index aa78ed9..b81d4a4 100644 --- a/app/views/admin/p_customer_sheets/_p_customer_sheet.html.haml +++ b/app/views/admin/p_customer_sheets/_p_customer_sheet.html.haml @@ -1,26 +1,28 @@ -%tr#p_customer_sheet{:id => p_customer_sheet.id} - %td="##{p_customer_sheet.id}" - %td=l p_customer_sheet.created_at, :format => :date - -if !@p_customer - %td= p_customer_sheet.p_customer.show_name if p_customer_sheet.p_customer - %td= p_customer_sheet.sheet_lines_not_shiped.count - %td= p_customer_sheet.sheet_lines_shiped.count +-if (p_customer_sheet.state != "panier" or p_customer_sheet.p_sheet_lines.count > 0) + %tr#p_customer_sheet{:id => p_customer_sheet.id} + %td="##{p_customer_sheet.id}" + %td=l p_customer_sheet.created_at, :format => :date + -if !@p_customer + %td= p_customer_sheet.p_customer.show_name if p_customer_sheet.p_customer + %td= p_customer_sheet.sheet_lines_not_shiped.count + %td= p_customer_sheet.sheet_lines_shiped.count - %td - -totals = PSheetLine.totals(p_customer_sheet.p_sheet_lines) - =number_to_currency totals[:total] + %td + -totals = PSheetLine.totals(p_customer_sheet.p_sheet_lines) + =number_to_currency totals[:total] - %td - =number_to_currency totals[:total_ttc] + %td + =number_to_currency totals[:total_ttc] - %td=raw p_customer_sheet.state_html + %td + =raw p_customer_sheet.state_html - %td.actions - -if p_customer_sheet.state == "brouillon" - = link_to i(:"trash-o"), [:admin, p_customer_sheet], method: :delete, data: { confirm: 'Voulez-vous vraiment supprimer cet auteur ? ' } , :remote => true - = link_to i(:pencil), edit_admin_p_customer_sheet_path(p_customer_sheet), :remote => false - = link_to i(:eye), admin_p_customer_sheet_path(p_customer_sheet), :remote => false + %td.actions + -if p_customer_sheet.state == "brouillon" + = link_to i(:"trash-o"), [:admin, p_customer_sheet], method: :delete, data: { confirm: 'Voulez-vous vraiment supprimer cet auteur ? ' } , :remote => true + = link_to i(:pencil), edit_admin_p_customer_sheet_path(p_customer_sheet), :remote => false + = link_to i(:eye), admin_p_customer_sheet_path(p_customer_sheet), :remote => false diff --git a/app/views/admin/p_documents/send_by_mail.html.haml b/app/views/admin/p_documents/send_by_mail.html.haml index 64e4f4c..85de7e2 100644 --- a/app/views/admin/p_documents/send_by_mail.html.haml +++ b/app/views/admin/p_documents/send_by_mail.html.haml @@ -18,10 +18,8 @@ %table.table.table-striped -p_contacts = @p_customer.p_contacts - - -p_contacts = p_contacts + @p_document.particular_send.p_contacts if @p_document.particular_send - - -p_contacts = p_contacts + @p_document.particular_bill.p_contacts if @p_document.particular_bill + -@p_customer.particulars.each do |p| + -p_contacts = p_contacts + p.p_contacts -p_contacts.uniq.each do |p_c|