Merge branch 'develop' of https://github.com/bigcapitalhq/client into develop

This commit is contained in:
a.bouhuolia
2021-12-27 11:08:10 +02:00
6 changed files with 23 additions and 15 deletions

View File

@@ -50,7 +50,7 @@ function VendorCreditNoteForm({
isNewMode,
submitPayload,
vendorCredit,
bill,
newVendorCredit,
createVendorCreditMutate,
editVendorCreditMutate,
} = useVendorCreditNoteFormContext();
@@ -73,9 +73,7 @@ function VendorCreditNoteForm({
...(vendorcreditAutoIncrement && {
vendor_credit_number: vendorCreditNumber,
}),
...transformToEditForm({
...pick(bill, ['vendor_id', 'entries']),
}),
...newVendorCredit,
}),
}),
[vendorCredit, base_currency],

View File

@@ -20,7 +20,7 @@ const VendorCreditNoteFormContext = React.createContext();
*/
function VendorCreditNoteFormProvider({ vendorCreditId, ...props }) {
const { state } = useLocation();
const billId = state?.billId;
// Handle fetching the items table based on the given query.
@@ -61,6 +61,12 @@ function VendorCreditNoteFormProvider({ vendorCreditId, ...props }) {
// Determines whether the form in new mode.
const isNewMode = !vendorCreditId;
const newVendorCredit = !isEmpty(bill)
? transformToEditForm({
...pick(bill, ['vendor_id', 'entries']),
})
: [];
// Provider payload.
const provider = {
items,
@@ -68,7 +74,7 @@ function VendorCreditNoteFormProvider({ vendorCreditId, ...props }) {
vendorCredit,
submitPayload,
isNewMode,
bill,
newVendorCredit,
isVendorCreditLoading,

View File

@@ -12,10 +12,10 @@ export default function VendorsCreditNoteEmptyStatus() {
const history = useHistory();
return (
<EmptyStatus
title={<T id={'the_organization_doesn_t_receive_money_yet'} />}
title={<T id={'vendor_credits.empty_status.title'} />}
description={
<p>
<T id={'vendor_credits.empty_status_description'} />
<T id={'vendor_credits.empty_status.description'} />
</p>
}
action={
@@ -26,7 +26,7 @@ export default function VendorsCreditNoteEmptyStatus() {
large={true}
onClick={() => history.push('/vendor-credits/new')}
>
<T id={'vendor_credits.action.new_vendor_credit'} />
<T id={'vendor_credits.label.new_vendor_credit'} />
</Button>
<Button intent={Intent.NONE} large={true}>

View File

@@ -12,10 +12,10 @@ export default function CreditNotesEmptyStatus() {
const history = useHistory();
return (
<EmptyStatus
title={<T id={'the_organization_doesn_t_receive_money_yet'} />}
title={<T id={'credit_note.empty_status.title'} />}
description={
<p>
<T id={'credit_note.empty_status_description'} />
<T id={'credit_note.empty_status.description'} />
</p>
}
action={