I Need To Edit My Invoice But How To Fill Invoice Items In It

Posted 8 months ago by partabsaifzakir

I'm using Laravel 5.7 & VueJs 2.5.* ...

I'm using a single Bootstrap Model to create as well as edit my TicketInvoice & it's TicketInvocieItems, but when i hit Edit, Bootstrap Model opens & i see data fill with TicketInvoice but can't see data of TicketInvoiceItems. I don't know how to fill data with of TicketInvoiceItems as well.

My HTML edit Button:

    <a href="#" @click="editModel(ticketInvoice)">
      <i class="fas fa-user-edit fa-lg text-orange"></i>
    </a>

My VueJs code:

<script>
/*==============EDIT INVOICE CODE==============*/
    editModel(ticketInvoice) {
      this.editmode = true;
      this.form.reset();
      this.form.clear();
      $("#addNewTicketInvoice").modal("show");
      this.form.fill(ticketInvoice);
    },
/*==============END EDIT INVOICE CODE==============*/
</script>

My data() in VueJs

<script>
export default {
      data() {
        return {
          editmode: true,
          ticketInvoices: {},
          vendors: null,
          form: new Form({
            id: "",
            vendor_id: "",
            ticket_invoice_no: "",
            ticket_invoice_date: "",
            ticket_invoice_fares_total: "",
            ticket_invoice_grand_total: "",

            ticketInvoiceItems: [{
              id: "",
              ticket_invoice_id: "",
              passenger_name: "",
              ticket_no: "",
              departure_date: "",
              fares: "",
              sub_total: ""
            }]
          })
        };
      },
</script>

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.