220 lines
6.2 KiB
Plaintext
220 lines
6.2 KiB
Plaintext
.qi_header
|
|
.right
|
|
= link_to i(:pencil), edit_admin_p_customer_path(@p_customer), :remote => true
|
|
%h1
|
|
Clients
|
|
%span
|
|
Détail d'un client
|
|
|
|
|
|
.qi_row
|
|
.qi_pannel.qi_plain.padding
|
|
%p
|
|
=@p_customer.show_name
|
|
%p
|
|
Code parrain :
|
|
%strong=@p_customer.mlm_token
|
|
|
|
|
|
|
|
.qi_row#tabs
|
|
.qi_pannel
|
|
%ul.nav.nav-tabs
|
|
-params[:tab] = params[:tab] || "offres"
|
|
%li{:class => ("active" if params[:tab] == "offres")}=link_to "Offres", "?tab=offres#tabs"
|
|
%li{:class => ("active" if params[:tab] == "etat")}=link_to "Etat de compte", "?tab=etat#tabs"
|
|
%li{:class => ("active" if params[:tab] == "bills")}=link_to "Factures & Avoirs", "?tab=bills#tabs"
|
|
%li{:class => ("active" if params[:tab] == "payments")}=link_to "Paiements", "?tab=payments#tabs"
|
|
|
|
%li{:class => ("active" if params[:tab] == "mails")}=link_to "Mails", "?tab=mails#tabs"
|
|
|
|
|
|
|
|
.tab-content{:style => "min-height:1000px;margin-bottom:300px;"}
|
|
|
|
-if params[:tab] == "mails"
|
|
#mails
|
|
.qi_row
|
|
.qi_pannel.qi_plain.padding
|
|
|
|
%h3 Mails
|
|
%table.table.table-hover.table-striped
|
|
%tr
|
|
|
|
%th Date
|
|
|
|
|
|
%th Destinataire
|
|
%th Mail
|
|
|
|
|
|
|
|
%tbody#mail_histories_rows
|
|
=render @p_customer.mail_histories.order("sended_at DESC")
|
|
|
|
|
|
|
|
-if params[:tab] == "offres"
|
|
#offres
|
|
.qi_row
|
|
.qi_pannel.qi_plain.padding
|
|
.right
|
|
=link_to "Nouvelle offre pour le client", new_admin_p_customer_sheet_path(:p_customer_id => @p_customer.id), :class => "btn btn-primary bgbd-ventes"
|
|
%h3 Offres
|
|
.clear
|
|
|
|
%hr
|
|
-if false
|
|
%p
|
|
CA HT :
|
|
=number_to_currency @p_customer.sheets_total_ht
|
|
%p
|
|
CA TTC :
|
|
=number_to_currency @p_customer.solde_avoir_and_bills
|
|
|
|
|
|
%hr
|
|
|
|
%table.table.table-hover.table-striped
|
|
%tr
|
|
%th ID
|
|
%th Date
|
|
|
|
|
|
%th Non livrés
|
|
%th Livrés
|
|
%th Total HT
|
|
%th Total TTC
|
|
%th Statut
|
|
|
|
%th
|
|
|
|
|
|
|
|
%tbody#p_customer_sheets_rows
|
|
- @p_customer_sheets = @p_customer.p_customer_sheets.order("created_at DESC")
|
|
-per_page = (params[:per_page] and params[:per_page] != "") ? params[:per_page] : 30
|
|
-page = (params[:page] and params[:page] != "") ? params[:page] : 1
|
|
-@p_customer_sheets = @p_customer_sheets.page(page).per(per_page)
|
|
|
|
=render @p_customer_sheets
|
|
|
|
.qi_pagination
|
|
= paginate @p_customer_sheets
|
|
|
|
-if params[:tab] == "etat"
|
|
#etat
|
|
.qi_row
|
|
.qi_pannel.qi_plain.padding
|
|
.right
|
|
= link_to 'Ajouter un paiement', new_admin_p_payment_path(:p_customer_id => @p_customer.id), :class => "btn btn-primary bgbd-payments", :remote => true
|
|
|
|
%h3
|
|
Etat de compte
|
|
|
|
|
|
=render :partial => "search_etat_form"
|
|
|
|
|
|
-if false
|
|
-@p_customer.p_compta_elements.destroy_all
|
|
-@p_customer.p_documents.each do |pd|
|
|
-pd.save
|
|
|
|
-@p_customer.p_payments.each do |pd|
|
|
-pd.save
|
|
|
|
|
|
=render :partial => "admin/p_customers/etat", :locals => {:p_customer => @p_customer}
|
|
|
|
-if params[:tab] == "bills"
|
|
#bills
|
|
.qi_row
|
|
.qi_pannel.qi_plain.padding
|
|
|
|
%h3
|
|
Factures & acomptes
|
|
=#%p
|
|
=#link_to "Documents du client", admin_p_customer_p_documents_path(@p_customer)
|
|
.clear
|
|
|
|
|
|
%hr
|
|
-if params[:doc_label]
|
|
%p
|
|
Factures
|
|
=params[:doc_label]
|
|
%table.table.table-hover.table-striped
|
|
%tr
|
|
|
|
%th Date
|
|
%th Offre
|
|
%th Client
|
|
%th Type
|
|
%th Numéro
|
|
%th Total HT
|
|
%th Total TTC
|
|
%th
|
|
Payée
|
|
%th Solde
|
|
%th Echéance
|
|
|
|
%th Jours de retard
|
|
%th
|
|
|
|
|
|
%tbody#p_customer_sheets_rows
|
|
-@p_documents = @p_customer.p_documents.order("created_at DESC")
|
|
-@p_documents = @p_documents.where(:p_document_type_id => PDocument::COMPTA_DOC_TYPES)
|
|
-if params[:p_document_ids]
|
|
-@p_documents = @p_documents.where(:id => params[:p_document_ids])
|
|
=render @p_documents
|
|
|
|
|
|
|
|
|
|
|
|
-if params[:tab] == "payments"
|
|
#payments
|
|
|
|
|
|
.qi_row
|
|
.qi_pannel.qi_plain.padding
|
|
.right
|
|
= link_to 'Ajouter un paiement', new_admin_p_payment_path(:p_customer_id => @p_customer.id), :class => "btn btn-primary bgbd-payments", :remote => true
|
|
%h3
|
|
Paiements
|
|
="(#{@p_customer.p_payments.count})"
|
|
.clear
|
|
|
|
|
|
|
|
%hr
|
|
|
|
%p
|
|
Total paiements :
|
|
=number_to_currency @p_customer.paiements_total
|
|
|
|
%hr
|
|
|
|
%table.table.table-hover.table-striped
|
|
%tr
|
|
%th
|
|
%th Type de paiement
|
|
%th Date de paiement
|
|
%th Date théorique
|
|
|
|
%th Client
|
|
%th Montant
|
|
%th Montant à affecter
|
|
%th
|
|
%th
|
|
%th
|
|
|
|
|
|
%tbody#p_payments_rows
|
|
=render @p_customer.p_payments.order("paid_at DESC")
|
|
|
|
|
|
|