|
|
|
|
@ -116,6 +116,15 @@ sub customer_by_id {
|
|
|
|
|
sub update_customer {
|
|
|
|
|
my ($self, $c, $customer, $old_resource, $resource, $form) = @_;
|
|
|
|
|
|
|
|
|
|
my $old_hal = $self->hal_from_customer($c, $customer, $form);
|
|
|
|
|
$c->model('DB')->resultset('journals')->create({
|
|
|
|
|
type => "update",
|
|
|
|
|
resource => "customers",
|
|
|
|
|
resource_id => $customer->id,
|
|
|
|
|
timestamp => NGCP::Panel::Utils::DateTime::current_local->hires_epoch,
|
|
|
|
|
content => $self->to_json($old_hal->resource),
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
my $billing_mapping = $customer->billing_mappings->find($customer->get_column('bmid'));
|
|
|
|
|
$old_resource->{billing_profile_id} = $billing_mapping->billing_profile_id;
|
|
|
|
|
$old_resource->{prepaid} = $billing_mapping->billing_profile->prepaid;
|
|
|
|
|
|