Bienvenido a los foros %s

Foro comunidad hispana Dolibarr

Identificarse Registrarse

Array asociativo al insertar

Discusión sobre la creación de nuevos modulos
vivescloud
Novato
Mensajes: 32
Registrado: Lun, 11/06/2018, 23:27
Ubicación: Guadalajara, Jalisco, México

Array asociativo al insertar

Mensaje por vivescloud »

Es posible insertar un array asociativo? o se tiene que generar toda la cadena sql para poder insertar un registro en la base de datos?

Avatar de Usuario
aitorxs
Almirante
Mensajes: 306
Registrado: Mar, 03/02/2015, 17:46

Mensaje por aitorxs »

Hola compañero, podrias indicar que tipo de registro estas tratando de realizar?
sistemas@machfree.com | http://www.machfree.com | Trujillo - Perú
*Si no respondo los mensajes....enviame un email ;)

vivescloud
Novato
Mensajes: 32
Registrado: Lun, 11/06/2018, 23:27
Ubicación: Guadalajara, Jalisco, México

Mensaje por vivescloud »

estoy tratando de modificar la inserción de un ticket del tpv pos, lo compré para la versión 3, pero ahora que ando aburrido y desactualizado, he decidido intentar actualizarlo a la versión 10.

Código: Seleccionar todo

 $data =  array(
            'ticketnumber' => "'(PROV)'",
            'entity' =>$conf->entity,
            'type' =>$this->type,
            'fk_cash' => $this->fk_cash,
            'fk_soc' =>$this->socid,
            'date_creation' => '"'.$this->db->idate($now).'"',
            'date_closed' => '"'.($this->statut==1 ? $this->db->idate($now):'NULL').'"',
            'remise_absolute' =>'"'.($this->remise_absolue > 0 ? $this->remise_absolue : 'NULL').'"',
            'remise_percent' =>'"'.($this->remise_percent>0?$this->remise_percent:'NULL').'"',
            'customer_pay' =>$this->customer_pay,
            'difpayment' =>$this->diff_payment,
            'date_ticket' =>'"'.$this->db->idate($now).'"',
            'note' =>'"'.($this->note?"'".$this->db->escape($this->note)."'":"NULL").'"',
            'note_public' =>'"'.($this->note_public?"'".$this->db->escape($this->note_public)."'":"NULL").'"',
            'fk_statut' =>$this->statut,
            'fk_user_author' =>$user,
            'fk_user_close' =>($this->statut==1 ? "'".$user."'":"null"),
            'fk_mode_reglement' =>$this->mode_reglement_id,
            'model_pdf' =>$this->modelpdf,
            'fk_ticket_source' =>$this->id_source,
            'fk_place' =>($this->fk_place ? $this->fk_place: 'null')
        );
estos son los datos que intento introducir, ya asociados.

ingeniohosting
Novato
Mensajes: 2
Registrado: Sab, 04/07/2020, 02:09

Mensaje por ingeniohosting »

hola como puedo ayudarte