This commit is contained in:
Nicolas Bally 2019-06-27 21:15:47 +02:00
parent 3c999a0d43
commit def87cf72f
4 changed files with 17 additions and 5 deletions

View File

@ -42,8 +42,8 @@ class Admin::PPaymentsController < ApplicationController
if @p_payment.save
@p_payments = PPayment.all
@p_payment = PPayment.find(@p_payment.id)
@p_customer = @p_payment.p_customer
else
render action: "new"

View File

@ -1,4 +1,4 @@
%tr#p_payment{:id => p_payment.id}
%tr#p_payment_row{:id => p_payment.id}
%td= ic(:check) if p_payment.paid
%td= l(p_payment.paid_at, :format => :date) if p_payment.paid_at
%td= l(p_payment.theo_date, :format => :date) if p_payment.theo_date

View File

@ -1,2 +1,7 @@
$('#p_payments_rows').html("<%= escape_javascript(render(@p_payments))%>");
$('#p_payments_rows').prepend("<%= escape_javascript(render(@p_payment))%>");
$('#p_customer_etat_<%= @p_payment.p_customer.id %> .lines').prepend("<%= escape_javascript(render(:partial => "admin/p_compta_elements/p_compta_element", :locals => {:p_compta_element => @p_payment.p_compta_element}))%>");
close_pane_hover();

View File

@ -1,2 +1,9 @@
$('#p_payments_rows').html("<%= escape_javascript(render(@p_payments))%>");
<% @p_customer = @p_payment.p_customer %>
$('#p_payment_row_<%= @p_payment.id %>').replaceWith("<%= escape_javascript(render(@p_payment))%>");
$('#p_compta_element_<%= @p_payment.p_compta_element.id %>').replaceWith("<%= escape_javascript(render(@p_payment.p_compta_element))%>");
close_pane_hover();