Add converted order total (#1072)
Co-authored-by: elsiosanchez <elsiossanches@gmail.com>pull/3793/head
							parent
							
								
									aa36f5911c
								
							
						
					
					
						commit
						90deabf9d2
					
				| 
						 | 
				
			
			@ -638,7 +638,7 @@ export default {
 | 
			
		|||
      if (!this.isEmptyValue(this.convertionsList)) {
 | 
			
		||||
        let rate
 | 
			
		||||
        payment.forEach((pay) => {
 | 
			
		||||
          rate = this.convertionsList.find(currency => currency.currencyTo.uuid === pay.currencyUuid)
 | 
			
		||||
          rate = this.convertionsList.find(currency => !this.isEmptyValue(currency.currencyTo) && currency.currencyTo.uuid === pay.currencyUuid)
 | 
			
		||||
          if (!rate) {
 | 
			
		||||
            if (this.currentPointOfSales.priceList.currency.uuid !== pay.currencyUuid) {
 | 
			
		||||
              this.searchConversion(pay.currencyUuid)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -184,7 +184,7 @@ export default {
 | 
			
		|||
    formatDate,
 | 
			
		||||
    formatPrice,
 | 
			
		||||
    iSOCode(value) {
 | 
			
		||||
      const currencyPay = this.convertionsList.find(currency => currency.currencyTo.uuid === value.currencyUuid)
 | 
			
		||||
      const currencyPay = this.convertionsList.find(currency => !this.isEmptyValue(currency.currencyTo) && currency.currencyTo.uuid === value.currencyUuid)
 | 
			
		||||
      if (!currencyPay) {
 | 
			
		||||
        return ''
 | 
			
		||||
      }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -696,7 +696,7 @@ export default {
 | 
			
		|||
        }
 | 
			
		||||
      }).catch(() => {
 | 
			
		||||
      }).finally(() => {
 | 
			
		||||
        this.$store.commit('setListPayments', [])
 | 
			
		||||
        this.$store.commit('setListPayments', {})
 | 
			
		||||
        const { templateBusinessPartner } = this.currentPointOfSales
 | 
			
		||||
        this.$store.commit('updateValuesOfContainer', {
 | 
			
		||||
          containerUuid: this.metadata.containerUuid,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -62,7 +62,7 @@
 | 
			
		|||
                  @command="changeDocumentType"
 | 
			
		||||
                >
 | 
			
		||||
                  <span>
 | 
			
		||||
                    <icon class="el-icon-document" />
 | 
			
		||||
                    <el-icon class="el-icon-document" />
 | 
			
		||||
                    <b style="cursor: pointer"> {{ currentDocumentType.name }} </b>
 | 
			
		||||
                  </span>
 | 
			
		||||
                  <el-dropdown-menu slot="dropdown">
 | 
			
		||||
| 
						 | 
				
			
			@ -335,14 +335,15 @@
 | 
			
		|||
              <p class="total">{{ $t('form.pos.order.seller') }}:<b style="float: right;">
 | 
			
		||||
                {{ currentOrder.salesRepresentative.name }}
 | 
			
		||||
              </b></p>
 | 
			
		||||
              <p class="total"> {{ $t('form.pos.order.subTotal') }}:<b class="order-info">{{ formatPrice(currentOrder.totalLines, pointOfSalesCurrency.iSOCode) }}</b></p>
 | 
			
		||||
              <p class="total"> {{ $t('form.pos.order.tax') }}:<b style="float: right;">{{ getOrderTax(pointOfSalesCurrency.iSOCode) }}</b> </p>
 | 
			
		||||
              <p class="total"> {{ $t('form.pos.order.subTotal') }}:<b v-if="!isEmptyValue(currentOrder.uuid)" class="order-info">{{ formatPrice(currentOrder.totalLines, pointOfSalesCurrency.iSOCode) }}</b></p>
 | 
			
		||||
              <p class="total"> {{ $t('form.pos.order.tax') }}:<b v-if="!isEmptyValue(currentOrder.uuid)" style="float: right;">{{ getOrderTax(pointOfSalesCurrency.iSOCode) }}</b> </p>
 | 
			
		||||
              <p class="total">
 | 
			
		||||
                <b>
 | 
			
		||||
                  {{ $t('form.pos.order.total') }}:
 | 
			
		||||
                </b>
 | 
			
		||||
                <b style="float: right;">
 | 
			
		||||
                  <el-popover
 | 
			
		||||
                    v-if="!isEmptyValue(currentOrder.uuid)"
 | 
			
		||||
                    :v-model="seeConversion"
 | 
			
		||||
                    placement="top-start"
 | 
			
		||||
                    trigger="click"
 | 
			
		||||
| 
						 | 
				
			
			@ -361,27 +362,29 @@
 | 
			
		|||
                  </el-popover>
 | 
			
		||||
                </b>
 | 
			
		||||
              </p>
 | 
			
		||||
              <p v-if="!isEmptyValue(currentPointOfSales.displayCurrency)" class="total"> <b> {{ $t('form.pos.collect.convertedAmount') }}: </b> <b v-if="!isEmptyValue(currentOrder.uuid)" style="float: right;">{{ formatPrice(currentOrder.grandTotal / totalAmountConverted, currentPointOfSales.displayCurrency.iso_code) }}</b> </p>
 | 
			
		||||
            </span>
 | 
			
		||||
            <span v-if="!isMobile" style="float: right;padding-right: 3%;">
 | 
			
		||||
              <p class="total">{{ $t('form.pos.order.order') }}: <b class="order-info">{{ currentOrder.documentNo }}</b></p>
 | 
			
		||||
              <p class="total">
 | 
			
		||||
                {{ $t('form.pos.order.date') }}:
 | 
			
		||||
                <b class="order-info">
 | 
			
		||||
                <b v-if="!isEmptyValue(currentOrder.uuid)" class="order-info">
 | 
			
		||||
                  {{ orderDate }}
 | 
			
		||||
                </b>
 | 
			
		||||
              </p>
 | 
			
		||||
              <p class="total">{{ $t('form.pos.order.type') }}:<b class="order-info">{{ currentOrder.documentType.name }}</b></p>
 | 
			
		||||
              <p class="total">
 | 
			
		||||
                {{ $t('form.pos.order.itemQuantity') }}
 | 
			
		||||
                <b class="order-info">
 | 
			
		||||
                <b v-if="!isEmptyValue(currentOrder.uuid)" class="order-info">
 | 
			
		||||
                  {{ getItemQuantity }}
 | 
			
		||||
                </b>
 | 
			
		||||
              </p>
 | 
			
		||||
              <p class="total">
 | 
			
		||||
                {{ $t('form.pos.order.numberLines') }}
 | 
			
		||||
                <b class="order-info">
 | 
			
		||||
                <b v-if="!isEmptyValue(currentOrder.uuid)" class="order-info">
 | 
			
		||||
                  {{ numberOfLines }}
 | 
			
		||||
                </b></p>
 | 
			
		||||
                </b>
 | 
			
		||||
              </p>
 | 
			
		||||
            </span>
 | 
			
		||||
          </el-footer>
 | 
			
		||||
        </el-container>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -593,7 +593,7 @@ export default {
 | 
			
		|||
        }
 | 
			
		||||
      }).catch(() => {
 | 
			
		||||
      }).finally(() => {
 | 
			
		||||
        this.$store.commit('setListPayments', [])
 | 
			
		||||
        this.$store.commit('setListPayments', {})
 | 
			
		||||
        const { templateBusinessPartner } = this.currentPointOfSales
 | 
			
		||||
        this.$store.commit('updateValuesOfContainer', {
 | 
			
		||||
          containerUuid: this.metadata.containerUuid,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue