mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 22:00:31 +00:00
Merge branch 'develop' of https://github.com/bigcapitalhq/client into develop
This commit is contained in:
@@ -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],
|
||||
|
||||
@@ -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,
|
||||
|
||||
|
||||
@@ -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}>
|
||||
|
||||
@@ -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={
|
||||
|
||||
Reference in New Issue
Block a user