mirror of
				https://github.com/crater-invoice/crater.git
				synced 2025-11-03 22:13:18 -05:00 
			
		
		
		
	Merge branch 'fix-alert' into 'master'
refactor sweet-alert and add related icons in alert See merge request mohit.panjvani/crater-web!11
This commit is contained in:
		@ -307,7 +307,9 @@ export default {
 | 
			
		||||
    send_invoice: 'Send Invoice',
 | 
			
		||||
    invoice_template: 'Invoice Template',
 | 
			
		||||
    template: 'Template',
 | 
			
		||||
    mark_as_sent: 'Mark as Sent',
 | 
			
		||||
    mark_as_sent: 'Mark as sent',
 | 
			
		||||
    invoice_mark_as_sent: 'This invoice will be marked as sent',
 | 
			
		||||
    confirm_send: 'This invoice will be sent via email to the customer',
 | 
			
		||||
    invoice_date: 'Invoice Date',
 | 
			
		||||
    record_payment: 'Record Payment',
 | 
			
		||||
    add_new_invoice: 'Add New Invoice',
 | 
			
		||||
 | 
			
		||||
@ -312,6 +312,8 @@ export default {
 | 
			
		||||
    invoice_template: 'Plantilla de factura',
 | 
			
		||||
    template: 'Modelo',
 | 
			
		||||
    mark_as_sent: 'Marcar como enviado',
 | 
			
		||||
    invoice_mark_as_sent: 'Esta factura se marcará como enviada',
 | 
			
		||||
    confirm_send: 'Estas facturas se enviarán por correo electrónico al cliente.',
 | 
			
		||||
    invoice_date: 'Fecha de la factura',
 | 
			
		||||
    record_payment: 'Registro de pago',
 | 
			
		||||
    add_new_invoice: 'Añadir nueva factura',
 | 
			
		||||
 | 
			
		||||
@ -312,6 +312,8 @@ export default {
 | 
			
		||||
    invoice_template: 'Modèle de facture',
 | 
			
		||||
    template: 'Modèle',
 | 
			
		||||
    mark_as_sent: 'Marquer comme envoyé',
 | 
			
		||||
    invoice_mark_as_sent: 'Cette facture sera marquée comme envoyé',
 | 
			
		||||
    confirm_send: 'Cette facture sera envoyée par courrier électronique au client.',
 | 
			
		||||
    invoice_date: 'Date de facturation',
 | 
			
		||||
    record_payment: 'Record de paiement',
 | 
			
		||||
    add_new_invoice: 'Ajouter une nouvelle facture',
 | 
			
		||||
 | 
			
		||||
@ -247,13 +247,13 @@
 | 
			
		||||
                  {{ $t('invoices.view') }}
 | 
			
		||||
                </router-link>
 | 
			
		||||
              </v-dropdown-item>
 | 
			
		||||
              <v-dropdown-item>
 | 
			
		||||
              <v-dropdown-item v-if="row.status == 'DRAFT'">
 | 
			
		||||
                <a class="dropdown-item" href="#" @click="sendInvoice(row.id)" >
 | 
			
		||||
                  <font-awesome-icon icon="paper-plane" class="dropdown-item-icon" />
 | 
			
		||||
                  {{ $t('invoices.send_invoice') }}
 | 
			
		||||
                </a>
 | 
			
		||||
              </v-dropdown-item>
 | 
			
		||||
              <v-dropdown-item v-if="row.status === 'DRAFT'">
 | 
			
		||||
              <v-dropdown-item v-if="row.status == 'DRAFT'">
 | 
			
		||||
                <a class="dropdown-item" href="#" @click="sentInvoice(row.id)">
 | 
			
		||||
                  <font-awesome-icon icon="check-circle" class="dropdown-item-icon" />
 | 
			
		||||
                  {{ $t('invoices.mark_as_sent') }}
 | 
			
		||||
@ -384,24 +384,44 @@ export default {
 | 
			
		||||
      'fetchCustomers'
 | 
			
		||||
    ]),
 | 
			
		||||
    async sendInvoice (id) {
 | 
			
		||||
      const data = {
 | 
			
		||||
        id: id
 | 
			
		||||
      }
 | 
			
		||||
      let response = await this.sendEmail(data)
 | 
			
		||||
      this.refreshTable()
 | 
			
		||||
      if (response.data) {
 | 
			
		||||
        window.toastr['success'](this.$tc('invoices.send_invoice'))
 | 
			
		||||
      }
 | 
			
		||||
      swal({
 | 
			
		||||
        title: this.$t('general.are_you_sure'),
 | 
			
		||||
        text: this.$t('invoices.confirm_send'),
 | 
			
		||||
        icon: '/assets/icon/paper-plane-solid.svg',
 | 
			
		||||
        buttons: true,
 | 
			
		||||
        dangerMode: true
 | 
			
		||||
      }).then(async (Send_Invoice) => {
 | 
			
		||||
        if (Send_Invoice) {
 | 
			
		||||
          const data = {
 | 
			
		||||
            id: id
 | 
			
		||||
          }
 | 
			
		||||
          let response = await this.sendEmail(data)
 | 
			
		||||
          this.refreshTable()
 | 
			
		||||
          if (response.data) {
 | 
			
		||||
            window.toastr['success'](this.$tc('invoices.send_invoice'))
 | 
			
		||||
          }
 | 
			
		||||
        }
 | 
			
		||||
      })
 | 
			
		||||
    },
 | 
			
		||||
    async sentInvoice (id) {
 | 
			
		||||
      const data = {
 | 
			
		||||
        id: id
 | 
			
		||||
      }
 | 
			
		||||
      let response = await this.markAsSent(data)
 | 
			
		||||
      this.refreshTable()
 | 
			
		||||
      if (response.data) {
 | 
			
		||||
        window.toastr['success'](this.$tc('invoices.mark_as_sent'))
 | 
			
		||||
      }
 | 
			
		||||
      swal({
 | 
			
		||||
        title: this.$t('general.are_you_sure'),
 | 
			
		||||
        text: this.$t('invoices.invoice_mark_as_sent'),
 | 
			
		||||
        icon: '/assets/icon/check-circle-solid.svg',
 | 
			
		||||
        buttons: true,
 | 
			
		||||
        dangerMode: true
 | 
			
		||||
      }).then(async (MarkAsSend_Invoice) => {
 | 
			
		||||
        if (MarkAsSend_Invoice) {
 | 
			
		||||
          const data = {
 | 
			
		||||
            id: id
 | 
			
		||||
          }
 | 
			
		||||
          let response = await this.markAsSent(data)
 | 
			
		||||
          this.refreshTable()
 | 
			
		||||
          if (response.data) {
 | 
			
		||||
            window.toastr['success'](this.$tc('invoices.mark_as_sent'))
 | 
			
		||||
          }
 | 
			
		||||
        }
 | 
			
		||||
      })
 | 
			
		||||
    },
 | 
			
		||||
    getStatus (val) {
 | 
			
		||||
      this.filters.status = {
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										1
									
								
								resources/assets/sass/base.scss
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								resources/assets/sass/base.scss
									
									
									
									
										vendored
									
									
								
							@ -111,6 +111,7 @@ code, .code {
 | 
			
		||||
    justify-content: center;
 | 
			
		||||
    align-items: center;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.swal-icon--custom {
 | 
			
		||||
    height: 50px !important;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user