mirror of
				https://github.com/crater-invoice/crater.git
				synced 2025-10-30 21:21:09 -04:00 
			
		
		
		
	Compare commits
	
		
			1 Commits
		
	
	
		
			fix-logout
			...
			fix-paymen
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| d6cc7564ac | 
| @ -435,7 +435,7 @@ class Payment extends Model implements HasMedia | |||||||
|             '{PAYMENT_DATE}' => $this->formattedPaymentDate, |             '{PAYMENT_DATE}' => $this->formattedPaymentDate, | ||||||
|             '{PAYMENT_MODE}' => $this->paymentMethod ? $this->paymentMethod->name : null, |             '{PAYMENT_MODE}' => $this->paymentMethod ? $this->paymentMethod->name : null, | ||||||
|             '{PAYMENT_NUMBER}' => $this->payment_number, |             '{PAYMENT_NUMBER}' => $this->payment_number, | ||||||
|             '{PAYMENT_AMOUNT}' => $this->reference_number, |             '{PAYMENT_AMOUNT}' => format_money_pdf($this->amount, $this->customer->currency), | ||||||
|         ]; |         ]; | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  | |||||||
| @ -35,7 +35,16 @@ | |||||||
|       </div> |       </div> | ||||||
|  |  | ||||||
|       <div |       <div | ||||||
|         class="grid col-span-12 mt-6 text-center xl:mt-0 sm:grid-cols-4 xl:text-right xl:col-span-3 xl:grid-cols-1 xxl:col-span-2" |         class=" | ||||||
|  |           grid | ||||||
|  |           col-span-12 | ||||||
|  |           mt-6 | ||||||
|  |           text-center | ||||||
|  |           xl:mt-0 | ||||||
|  |           sm:grid-cols-4 | ||||||
|  |           xl:text-right xl:col-span-3 xl:grid-cols-1 | ||||||
|  |           xxl:col-span-2 | ||||||
|  |         " | ||||||
|       > |       > | ||||||
|         <div class="px-6 py-2"> |         <div class="px-6 py-2"> | ||||||
|           <span class="text-xs leading-5 lg:text-sm"> |           <span class="text-xs leading-5 lg:text-sm"> | ||||||
| @ -168,12 +177,10 @@ const getChartInvoices = computed(() => { | |||||||
|   return [] |   return [] | ||||||
| }) | }) | ||||||
|  |  | ||||||
| const customerId = computed(() => route.params.id) |  | ||||||
|  |  | ||||||
| watch( | watch( | ||||||
|   () => customerId.value, |   route, | ||||||
|   (id) => { |   () => { | ||||||
|     if (id && route.name === 'customers.view') { |     if (route.params.id) { | ||||||
|       loadCustomer() |       loadCustomer() | ||||||
|     } |     } | ||||||
|     selectedYear.value = 'This year' |     selectedYear.value = 'This year' | ||||||
|  | |||||||
| @ -37,10 +37,32 @@ | |||||||
|  |  | ||||||
|     <!-- Sidebar --> |     <!-- Sidebar --> | ||||||
|     <div |     <div | ||||||
|       class="fixed top-0 left-0 hidden h-full pt-16 pb-[6.4rem] ml-56 bg-white xl:ml-64 w-88 xl:block" |       class=" | ||||||
|  |         fixed | ||||||
|  |         top-0 | ||||||
|  |         left-0 | ||||||
|  |         hidden | ||||||
|  |         h-full | ||||||
|  |         pt-16 | ||||||
|  |         pb-[6.4rem] | ||||||
|  |         ml-56 | ||||||
|  |         bg-white | ||||||
|  |         xl:ml-64 | ||||||
|  |         w-88 | ||||||
|  |         xl:block | ||||||
|  |       " | ||||||
|     > |     > | ||||||
|       <div |       <div | ||||||
|         class="flex items-center justify-between px-4 pt-8 pb-2 border border-gray-200 border-solid height-full" |         class=" | ||||||
|  |           flex | ||||||
|  |           items-center | ||||||
|  |           justify-between | ||||||
|  |           px-4 | ||||||
|  |           pt-8 | ||||||
|  |           pb-2 | ||||||
|  |           border border-gray-200 border-solid | ||||||
|  |           height-full | ||||||
|  |         " | ||||||
|       > |       > | ||||||
|         <div class="mb-6"> |         <div class="mb-6"> | ||||||
|           <BaseInput |           <BaseInput | ||||||
| @ -70,7 +92,14 @@ | |||||||
|             </template> |             </template> | ||||||
|  |  | ||||||
|             <div |             <div | ||||||
|               class="px-4 py-1 pb-2 mb-1 mb-2 text-sm border-b border-gray-200 border-solid" |               class=" | ||||||
|  |                 px-4 | ||||||
|  |                 py-1 | ||||||
|  |                 pb-2 | ||||||
|  |                 mb-1 mb-2 | ||||||
|  |                 text-sm | ||||||
|  |                 border-b border-gray-200 border-solid | ||||||
|  |               " | ||||||
|             > |             > | ||||||
|               {{ $t('general.sort_by') }} |               {{ $t('general.sort_by') }} | ||||||
|             </div> |             </div> | ||||||
| @ -127,7 +156,12 @@ | |||||||
|  |  | ||||||
|       <div |       <div | ||||||
|         ref="estimateListSection" |         ref="estimateListSection" | ||||||
|         class="h-full overflow-y-scroll border-l border-gray-200 border-solid base-scroll" |         class=" | ||||||
|  |           h-full | ||||||
|  |           overflow-y-scroll | ||||||
|  |           border-l border-gray-200 border-solid | ||||||
|  |           base-scroll | ||||||
|  |         " | ||||||
|       > |       > | ||||||
|         <div v-for="(estimate, index) in estimateList" :key="index"> |         <div v-for="(estimate, index) in estimateList" :key="index"> | ||||||
|           <router-link |           <router-link | ||||||
| @ -147,11 +181,29 @@ | |||||||
|               <BaseText |               <BaseText | ||||||
|                 :text="estimate.customer.name" |                 :text="estimate.customer.name" | ||||||
|                 :length="30" |                 :length="30" | ||||||
|                 class="pr-2 mb-2 text-sm not-italic font-normal leading-5 text-black capitalize truncate" |                 class=" | ||||||
|  |                   pr-2 | ||||||
|  |                   mb-2 | ||||||
|  |                   text-sm | ||||||
|  |                   not-italic | ||||||
|  |                   font-normal | ||||||
|  |                   leading-5 | ||||||
|  |                   text-black | ||||||
|  |                   capitalize | ||||||
|  |                   truncate | ||||||
|  |                 " | ||||||
|               /> |               /> | ||||||
|  |  | ||||||
|               <div |               <div | ||||||
|                 class="mt-1 mb-2 text-xs not-italic font-medium leading-5 text-gray-600" |                 class=" | ||||||
|  |                   mt-1 | ||||||
|  |                   mb-2 | ||||||
|  |                   text-xs | ||||||
|  |                   not-italic | ||||||
|  |                   font-medium | ||||||
|  |                   leading-5 | ||||||
|  |                   text-gray-600 | ||||||
|  |                 " | ||||||
|               > |               > | ||||||
|                 {{ estimate.estimate_number }} |                 {{ estimate.estimate_number }} | ||||||
|               </div> |               </div> | ||||||
| @ -168,11 +220,26 @@ | |||||||
|               <BaseFormatMoney |               <BaseFormatMoney | ||||||
|                 :amount="estimate.total" |                 :amount="estimate.total" | ||||||
|                 :currency="estimate.customer.currency" |                 :currency="estimate.customer.currency" | ||||||
|                 class="block mb-2 text-xl not-italic font-semibold leading-8 text-right text-gray-900" |                 class=" | ||||||
|  |                   block | ||||||
|  |                   mb-2 | ||||||
|  |                   text-xl | ||||||
|  |                   not-italic | ||||||
|  |                   font-semibold | ||||||
|  |                   leading-8 | ||||||
|  |                   text-right text-gray-900 | ||||||
|  |                 " | ||||||
|               /> |               /> | ||||||
|  |  | ||||||
|               <div |               <div | ||||||
|                 class="text-sm not-italic font-normal leading-5 text-right text-gray-600 est-date" |                 class=" | ||||||
|  |                   text-sm | ||||||
|  |                   not-italic | ||||||
|  |                   font-normal | ||||||
|  |                   leading-5 | ||||||
|  |                   text-right text-gray-600 | ||||||
|  |                   est-date | ||||||
|  |                 " | ||||||
|               > |               > | ||||||
|                 {{ estimate.formatted_estimate_date }} |                 {{ estimate.formatted_estimate_date }} | ||||||
|               </div> |               </div> | ||||||
| @ -197,7 +264,13 @@ | |||||||
|     > |     > | ||||||
|       <iframe |       <iframe | ||||||
|         :src="`${shareableLink}`" |         :src="`${shareableLink}`" | ||||||
|         class="flex-1 border border-gray-400 border-solid rounded-md bg-white frame-style" |         class=" | ||||||
|  |           flex-1 | ||||||
|  |           border border-gray-400 border-solid | ||||||
|  |           rounded-md | ||||||
|  |           bg-white | ||||||
|  |           frame-style | ||||||
|  |         " | ||||||
|       /> |       /> | ||||||
|     </div> |     </div> | ||||||
|   </BasePage> |   </BasePage> | ||||||
| @ -272,14 +345,11 @@ const getCurrentEstimateId = computed(() => { | |||||||
|   return null |   return null | ||||||
| }) | }) | ||||||
|  |  | ||||||
| const estimateId = computed(() => route.params.id) | watch(route, (to, from) => { | ||||||
|  |   if (to.name === 'estimates.view') { | ||||||
| watch( |     loadEstimate() | ||||||
|   () => estimateId.value, |  | ||||||
|   (id) => { |  | ||||||
|     if (id && route.name === 'estimates.view') loadEstimate() |  | ||||||
|   } |   } | ||||||
| ) | }) | ||||||
|  |  | ||||||
| loadEstimates() | loadEstimates() | ||||||
| loadEstimate() | loadEstimate() | ||||||
|  | |||||||
| @ -65,14 +65,11 @@ const getCurrentInvoiceId = computed(() => { | |||||||
|   return null |   return null | ||||||
| }) | }) | ||||||
|  |  | ||||||
| const invoiceId = computed(() => route.params.id) | watch(route, (to, from) => { | ||||||
|  |   if (to.name === 'invoices.view') { | ||||||
| watch( |     loadInvoice() | ||||||
|   () => invoiceId.value, |  | ||||||
|   (id) => { |  | ||||||
|     if (id && route.name === 'invoices.view') loadInvoice() |  | ||||||
|   } |   } | ||||||
| ) | }) | ||||||
|  |  | ||||||
| async function onMarkAsSent() { | async function onMarkAsSent() { | ||||||
|   dialogStore |   dialogStore | ||||||
| @ -289,10 +286,32 @@ onSearched = debounce(onSearched, 500) | |||||||
|  |  | ||||||
|     <!-- sidebar --> |     <!-- sidebar --> | ||||||
|     <div |     <div | ||||||
|       class="fixed top-0 left-0 hidden h-full pt-16 pb-[6.4rem] ml-56 bg-white xl:ml-64 w-88 xl:block" |       class=" | ||||||
|  |         fixed | ||||||
|  |         top-0 | ||||||
|  |         left-0 | ||||||
|  |         hidden | ||||||
|  |         h-full | ||||||
|  |         pt-16 | ||||||
|  |         pb-[6.4rem] | ||||||
|  |         ml-56 | ||||||
|  |         bg-white | ||||||
|  |         xl:ml-64 | ||||||
|  |         w-88 | ||||||
|  |         xl:block | ||||||
|  |       " | ||||||
|     > |     > | ||||||
|       <div |       <div | ||||||
|         class="flex items-center justify-between px-4 pt-8 pb-2 border border-gray-200 border-solid height-full" |         class=" | ||||||
|  |           flex | ||||||
|  |           items-center | ||||||
|  |           justify-between | ||||||
|  |           px-4 | ||||||
|  |           pt-8 | ||||||
|  |           pb-2 | ||||||
|  |           border border-gray-200 border-solid | ||||||
|  |           height-full | ||||||
|  |         " | ||||||
|       > |       > | ||||||
|         <div class="mb-6"> |         <div class="mb-6"> | ||||||
|           <BaseInput |           <BaseInput | ||||||
| @ -316,7 +335,14 @@ onSearched = debounce(onSearched, 500) | |||||||
|               </BaseButton> |               </BaseButton> | ||||||
|             </template> |             </template> | ||||||
|             <div |             <div | ||||||
|               class="px-2 py-1 pb-2 mb-1 mb-2 text-sm border-b border-gray-200 border-solid" |               class=" | ||||||
|  |                 px-2 | ||||||
|  |                 py-1 | ||||||
|  |                 pb-2 | ||||||
|  |                 mb-1 mb-2 | ||||||
|  |                 text-sm | ||||||
|  |                 border-b border-gray-200 border-solid | ||||||
|  |               " | ||||||
|             > |             > | ||||||
|               {{ $t('general.sort_by') }} |               {{ $t('general.sort_by') }} | ||||||
|             </div> |             </div> | ||||||
| @ -373,7 +399,12 @@ onSearched = debounce(onSearched, 500) | |||||||
|  |  | ||||||
|       <div |       <div | ||||||
|         ref="invoiceListSection" |         ref="invoiceListSection" | ||||||
|         class="h-full overflow-y-scroll border-l border-gray-200 border-solid base-scroll" |         class=" | ||||||
|  |           h-full | ||||||
|  |           overflow-y-scroll | ||||||
|  |           border-l border-gray-200 border-solid | ||||||
|  |           base-scroll | ||||||
|  |         " | ||||||
|       > |       > | ||||||
|         <div v-for="(invoice, index) in invoiceList" :key="index"> |         <div v-for="(invoice, index) in invoiceList" :key="index"> | ||||||
|           <router-link |           <router-link | ||||||
| @ -393,11 +424,29 @@ onSearched = debounce(onSearched, 500) | |||||||
|               <BaseText |               <BaseText | ||||||
|                 :text="invoice.customer.name" |                 :text="invoice.customer.name" | ||||||
|                 :length="30" |                 :length="30" | ||||||
|                 class="pr-2 mb-2 text-sm not-italic font-normal leading-5 text-black capitalize truncate" |                 class=" | ||||||
|  |                   pr-2 | ||||||
|  |                   mb-2 | ||||||
|  |                   text-sm | ||||||
|  |                   not-italic | ||||||
|  |                   font-normal | ||||||
|  |                   leading-5 | ||||||
|  |                   text-black | ||||||
|  |                   capitalize | ||||||
|  |                   truncate | ||||||
|  |                 " | ||||||
|               /> |               /> | ||||||
|  |  | ||||||
|               <div |               <div | ||||||
|                 class="mt-1 mb-2 text-xs not-italic font-medium leading-5 text-gray-600" |                 class=" | ||||||
|  |                   mt-1 | ||||||
|  |                   mb-2 | ||||||
|  |                   text-xs | ||||||
|  |                   not-italic | ||||||
|  |                   font-medium | ||||||
|  |                   leading-5 | ||||||
|  |                   text-gray-600 | ||||||
|  |                 " | ||||||
|               > |               > | ||||||
|                 {{ invoice.invoice_number }} |                 {{ invoice.invoice_number }} | ||||||
|               </div> |               </div> | ||||||
| @ -411,12 +460,27 @@ onSearched = debounce(onSearched, 500) | |||||||
|  |  | ||||||
|             <div class="flex-1 whitespace-nowrap right"> |             <div class="flex-1 whitespace-nowrap right"> | ||||||
|               <BaseFormatMoney |               <BaseFormatMoney | ||||||
|                 class="mb-2 text-xl not-italic font-semibold leading-8 text-right text-gray-900 block" |                 class=" | ||||||
|  |                   mb-2 | ||||||
|  |                   text-xl | ||||||
|  |                   not-italic | ||||||
|  |                   font-semibold | ||||||
|  |                   leading-8 | ||||||
|  |                   text-right text-gray-900 | ||||||
|  |                   block | ||||||
|  |                 " | ||||||
|                 :amount="invoice.total" |                 :amount="invoice.total" | ||||||
|                 :currency="invoice.customer.currency" |                 :currency="invoice.customer.currency" | ||||||
|               /> |               /> | ||||||
|               <div |               <div | ||||||
|                 class="text-sm not-italic font-normal leading-5 text-right text-gray-600 est-date" |                 class=" | ||||||
|  |                   text-sm | ||||||
|  |                   not-italic | ||||||
|  |                   font-normal | ||||||
|  |                   leading-5 | ||||||
|  |                   text-right text-gray-600 | ||||||
|  |                   est-date | ||||||
|  |                 " | ||||||
|               > |               > | ||||||
|                 {{ invoice.formatted_invoice_date }} |                 {{ invoice.formatted_invoice_date }} | ||||||
|               </div> |               </div> | ||||||
| @ -441,7 +505,13 @@ onSearched = debounce(onSearched, 500) | |||||||
|     > |     > | ||||||
|       <iframe |       <iframe | ||||||
|         :src="`${shareableLink}`" |         :src="`${shareableLink}`" | ||||||
|         class="flex-1 border border-gray-400 border-solid bg-white rounded-md frame-style" |         class=" | ||||||
|  |           flex-1 | ||||||
|  |           border border-gray-400 border-solid | ||||||
|  |           bg-white | ||||||
|  |           rounded-md | ||||||
|  |           frame-style | ||||||
|  |         " | ||||||
|       /> |       /> | ||||||
|     </div> |     </div> | ||||||
|   </BasePage> |   </BasePage> | ||||||
|  | |||||||
| @ -22,10 +22,31 @@ | |||||||
|  |  | ||||||
|     <!-- Sidebar --> |     <!-- Sidebar --> | ||||||
|     <div |     <div | ||||||
|       class="fixed top-0 left-0 hidden h-full pt-16 pb-[6rem] ml-56 bg-white xl:ml-64 w-88 xl:block" |       class=" | ||||||
|  |         fixed | ||||||
|  |         top-0 | ||||||
|  |         left-0 | ||||||
|  |         hidden | ||||||
|  |         h-full | ||||||
|  |         pt-16 | ||||||
|  |         pb-[6rem] | ||||||
|  |         ml-56 | ||||||
|  |         bg-white | ||||||
|  |         xl:ml-64 | ||||||
|  |         w-88 | ||||||
|  |         xl:block | ||||||
|  |       " | ||||||
|     > |     > | ||||||
|       <div |       <div | ||||||
|         class="flex items-center justify-between px-4 pt-8 pb-6 border border-gray-200 border-solid" |         class=" | ||||||
|  |           flex | ||||||
|  |           items-center | ||||||
|  |           justify-between | ||||||
|  |           px-4 | ||||||
|  |           pt-8 | ||||||
|  |           pb-6 | ||||||
|  |           border border-gray-200 border-solid | ||||||
|  |         " | ||||||
|       > |       > | ||||||
|         <BaseInput |         <BaseInput | ||||||
|           v-model="searchData.searchText" |           v-model="searchData.searchText" | ||||||
| @ -49,7 +70,14 @@ | |||||||
|             </template> |             </template> | ||||||
|  |  | ||||||
|             <div |             <div | ||||||
|               class="px-4 py-1 pb-2 mb-2 text-sm border-b border-gray-200 border-solid" |               class=" | ||||||
|  |                 px-4 | ||||||
|  |                 py-1 | ||||||
|  |                 pb-2 | ||||||
|  |                 mb-2 | ||||||
|  |                 text-sm | ||||||
|  |                 border-b border-gray-200 border-solid | ||||||
|  |               " | ||||||
|             > |             > | ||||||
|               {{ $t('general.sort_by') }} |               {{ $t('general.sort_by') }} | ||||||
|             </div> |             </div> | ||||||
| @ -131,17 +159,43 @@ | |||||||
|               <BaseText |               <BaseText | ||||||
|                 :text="payment?.customer?.name" |                 :text="payment?.customer?.name" | ||||||
|                 :length="30" |                 :length="30" | ||||||
|                 class="pr-2 mb-2 text-sm not-italic font-normal leading-5 text-black capitalize truncate" |                 class=" | ||||||
|  |                   pr-2 | ||||||
|  |                   mb-2 | ||||||
|  |                   text-sm | ||||||
|  |                   not-italic | ||||||
|  |                   font-normal | ||||||
|  |                   leading-5 | ||||||
|  |                   text-black | ||||||
|  |                   capitalize | ||||||
|  |                   truncate | ||||||
|  |                 " | ||||||
|               /> |               /> | ||||||
|  |  | ||||||
|               <div |               <div | ||||||
|                 class="mb-1 text-xs not-italic font-medium leading-5 text-gray-500 capitalize" |                 class=" | ||||||
|  |                   mb-1 | ||||||
|  |                   text-xs | ||||||
|  |                   not-italic | ||||||
|  |                   font-medium | ||||||
|  |                   leading-5 | ||||||
|  |                   text-gray-500 | ||||||
|  |                   capitalize | ||||||
|  |                 " | ||||||
|               > |               > | ||||||
|                 {{ payment?.payment_number }} |                 {{ payment?.payment_number }} | ||||||
|               </div> |               </div> | ||||||
|  |  | ||||||
|               <div |               <div | ||||||
|                 class="mb-1 text-xs not-italic font-medium leading-5 text-gray-500 capitalize" |                 class=" | ||||||
|  |                   mb-1 | ||||||
|  |                   text-xs | ||||||
|  |                   not-italic | ||||||
|  |                   font-medium | ||||||
|  |                   leading-5 | ||||||
|  |                   text-gray-500 | ||||||
|  |                   capitalize | ||||||
|  |                 " | ||||||
|               > |               > | ||||||
|                 {{ payment?.invoice_number }} |                 {{ payment?.invoice_number }} | ||||||
|               </div> |               </div> | ||||||
| @ -149,7 +203,15 @@ | |||||||
|  |  | ||||||
|             <div class="flex-1 whitespace-nowrap right"> |             <div class="flex-1 whitespace-nowrap right"> | ||||||
|               <BaseFormatMoney |               <BaseFormatMoney | ||||||
|                 class="block mb-2 text-xl not-italic font-semibold leading-8 text-right text-gray-900" |                 class=" | ||||||
|  |                   block | ||||||
|  |                   mb-2 | ||||||
|  |                   text-xl | ||||||
|  |                   not-italic | ||||||
|  |                   font-semibold | ||||||
|  |                   leading-8 | ||||||
|  |                   text-right text-gray-900 | ||||||
|  |                 " | ||||||
|                 :amount="payment?.amount" |                 :amount="payment?.amount" | ||||||
|                 :currency="payment.customer?.currency" |                 :currency="payment.customer?.currency" | ||||||
|               /> |               /> | ||||||
| @ -251,14 +313,9 @@ const paymentDate = computed(() => { | |||||||
|   ) |   ) | ||||||
| }) | }) | ||||||
|  |  | ||||||
| const paymentId = computed(() => route.params.id) | watch(route, () => { | ||||||
|  |   loadPayment() | ||||||
| watch( | }) | ||||||
|   () => paymentId.value, |  | ||||||
|   (id) => { |  | ||||||
|     if (id && route.name === 'payments.view') loadPayment() |  | ||||||
|   } |  | ||||||
| ) |  | ||||||
|  |  | ||||||
| loadPayments() | loadPayments() | ||||||
| loadPayment() | loadPayment() | ||||||
|  | |||||||
| @ -78,12 +78,10 @@ let isLoading = computed(() => { | |||||||
|   return recurringInvoiceStore.isFetchingViewData |   return recurringInvoiceStore.isFetchingViewData | ||||||
| }) | }) | ||||||
|  |  | ||||||
| const invoiceId = computed(() => route.params.id) |  | ||||||
|  |  | ||||||
| watch( | watch( | ||||||
|   () => invoiceId.value, |   route, | ||||||
|   (id) => { |   () => { | ||||||
|     if (id && route.name === 'recurring-invoices.view') { |     if (route.params.id && route.name === 'recurring-invoices.view') { | ||||||
|       loadRecurringInvoice() |       loadRecurringInvoice() | ||||||
|     } |     } | ||||||
|   }, |   }, | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user
	