fix: BIG-352 Add terms and conditions/notes field to a warehouse transfer.

This commit is contained in:
a.bouhuolia
2022-03-28 19:06:38 +02:00
parent d842722183
commit 767d807490
10 changed files with 80 additions and 58 deletions

View File

@@ -3,24 +3,28 @@ import intl from 'react-intl-universal';
import styled from 'styled-components'; import styled from 'styled-components';
import { FFormGroup, FEditableText, FormattedMessage as T } from 'components'; import { FFormGroup, FEditableText, FormattedMessage as T } from 'components';
/**
* Payment made form footer left-side.
* @returns {JSX.Element}
*/
export function PaymentMadeFormFooterLeft() { export function PaymentMadeFormFooterLeft() {
return ( return (
<React.Fragment> <React.Fragment>
{/* --------- Statement--------- */} {/* --------- Internal Note--------- */}
<StatementFormGroup <InternalNoteFormGroup
name={'statement'} name={'internal_note'}
label={<T id={'payment_made_form.label.statement'} />} label={<T id={'payment_made.form.internal_note.label'} />}
hintText={'Will be displayed on the Payment'}
> >
<FEditableText <FEditableText
name={'statement'} name={'internal_note'}
placeholder={intl.get('payment_made_form.statement.placeholder')} placeholder={intl.get('payment_made.form.internal_note.placeholder')}
/> />
</StatementFormGroup> </InternalNoteFormGroup>
</React.Fragment> </React.Fragment>
); );
} }
const StatementFormGroup = styled(FFormGroup)`
const InternalNoteFormGroup = styled(FFormGroup)`
&.bp3-form-group { &.bp3-form-group {
margin-bottom: 40px; margin-bottom: 40px;

View File

@@ -103,7 +103,7 @@ function PaymentMadeFormProvider({ query, paymentMadeId, ...props }) {
<DashboardInsider <DashboardInsider
loading={ loading={
isVendorsLoading || isVendorsLoading ||
isItemsFetching || isItemsLoading ||
isAccountsLoading || isAccountsLoading ||
isPaymentLoading isPaymentLoading
} }

View File

@@ -10,7 +10,6 @@ export function CreditNoteFormFooterLeft() {
<CreditNoteMsgFormGroup <CreditNoteMsgFormGroup
name={'note'} name={'note'}
label={<T id={'credit_note.label_customer_note'} />} label={<T id={'credit_note.label_customer_note'} />}
hintText={'Will be displayed on the invoice'}
> >
<FEditableText <FEditableText
name={'note'} name={'note'}
@@ -24,9 +23,9 @@ export function CreditNoteFormFooterLeft() {
> >
<FEditableText <FEditableText
name={'terms_conditions'} name={'terms_conditions'}
placeholder={ placeholder={intl.get(
<T id={'credit_note.label_terms_and_conditions.placeholder'} /> 'credit_note.label_terms_and_conditions.placeholder',
} )}
/> />
</TermsConditsFormGroup> </TermsConditsFormGroup>
</React.Fragment> </React.Fragment>

View File

@@ -10,7 +10,6 @@ export function InvoiceFormFooterLeft() {
<InvoiceMsgFormGroup <InvoiceMsgFormGroup
name={'invoice_message'} name={'invoice_message'}
label={<T id={'invoice_message'} />} label={<T id={'invoice_message'} />}
hintText={'Will be displayed on the invoice'}
> >
<FEditableText <FEditableText
name={'invoice_message'} name={'invoice_message'}
@@ -20,7 +19,7 @@ export function InvoiceFormFooterLeft() {
{/* --------- Terms and conditions --------- */} {/* --------- Terms and conditions --------- */}
<TermsConditsFormGroup <TermsConditsFormGroup
label={<T id={'invoice_form.label.invoice_message'} />} label={<T id={'invoice_form.label.terms_conditions'} />}
name={'terms_conditions'} name={'terms_conditions'}
> >
<FEditableText <FEditableText

View File

@@ -7,14 +7,24 @@ export function PaymentReceiveFormFootetLeft() {
return ( return (
<React.Fragment> <React.Fragment>
{/* --------- Statement--------- */} {/* --------- Statement--------- */}
<TermsConditsFormGroup <PaymentMsgFormGroup
name={'statement'} name={'message'}
label={<T id={'payment_receive_form.label.statement'} />} label={<T id={'payment_receive_form.message.label'} />}
hintText={'Will be displayed on the Payment'}
> >
<FEditableText <FEditableText
name={'statement'} name={'message'}
placeholder={intl.get('payment_receive_form.statement.placeholder')} placeholder={intl.get('payment_receive_form.message.placeholder')}
/>
</PaymentMsgFormGroup>
{/* --------- Internal Note--------- */}
<TermsConditsFormGroup
name={'internal_note'}
label={<T id={'payment_receive_form.label.internal_note'} />}
>
<FEditableText
name={'internal_note'}
placeholder={intl.get('payment_receive_form.internal_note.placeholder')}
/> />
</TermsConditsFormGroup> </TermsConditsFormGroup>
</React.Fragment> </React.Fragment>
@@ -32,3 +42,17 @@ const TermsConditsFormGroup = styled(FFormGroup)`
} }
} }
`; `;
const PaymentMsgFormGroup = styled(FFormGroup)`
&.bp3-form-group {
margin-bottom: 40px;
.bp3-label {
font-size: 12px;
margin-bottom: 12px;
}
.bp3-form-content {
margin-left: 10px;
}
}
`;

View File

@@ -1,5 +1,6 @@
import React from 'react'; import React from 'react';
import styled from 'styled-components'; import styled from 'styled-components';
import intl from 'react-intl-universal';
import { FFormGroup, FEditableText, FormattedMessage as T } from 'components'; import { FFormGroup, FEditableText, FormattedMessage as T } from 'components';
export function WarehouseTransferFormFooterLeft() { export function WarehouseTransferFormFooterLeft() {
@@ -7,14 +8,12 @@ export function WarehouseTransferFormFooterLeft() {
<React.Fragment> <React.Fragment>
{/* --------- Terms and conditions --------- */} {/* --------- Terms and conditions --------- */}
<TermsConditsFormGroup <TermsConditsFormGroup
label={<T id={'terms_conditions'} />} label={<T id={'warehouse_transfer.form.reason.label'} />}
name={'reason'} name={'reason'}
> >
<FEditableText <FEditableText
name={'reason'} name={'reason'}
placeholder={ placeholder={intl.get('warehouse_transfer.form.reason.placeholder')}
'Enter the terms and conditions of your business to be displayed in your transaction'
}
/> />
</TermsConditsFormGroup> </TermsConditsFormGroup>
</React.Fragment> </React.Fragment>

View File

@@ -1,7 +1,5 @@
import React from 'react'; import React from 'react';
import classNames from 'classnames'; import classNames from 'classnames';
import { useFormikContext } from 'formik';
import intl from 'react-intl-universal';
import { CLASSES } from 'common/classes'; import { CLASSES } from 'common/classes';
import WarehouseTransferFormHeaderFields from './WarehouseTransferFormHeaderFields'; import WarehouseTransferFormHeaderFields from './WarehouseTransferFormHeaderFields';

View File

@@ -183,20 +183,6 @@ function WarehouseTransferFormHeaderFields({
</FormGroup> </FormGroup>
)} )}
</FastField> </FastField>
{/*------------ reason -----------*/}
<FastField name={'reason'}>
{({ field, meta: { error, touched } }) => (
<FormGroup
label={<T id={'reason'} />}
className={'form-group--reason'}
intent={inputIntent({ error, touched })}
inline={true}
helperText={<ErrorMessage name={'reason'} />}
>
<InputGroup minimal={true} {...field} />
</FormGroup>
)}
</FastField>
</div> </div>
); );
} }

View File

@@ -2003,7 +2003,7 @@
"estimate.warehouse_button.label": "المخزن: {label}", "estimate.warehouse_button.label": "المخزن: {label}",
"receipt.branch_button.label": "الفرع: {label}", "receipt.branch_button.label": "الفرع: {label}",
"receipt.warehouse_button.label": "المخزن: {label}", "receipt.warehouse_button.label": "المخزن: {label}",
"warehouse_transfer.empty_status.title": "", "warehouse_transfer.empty_status.title": "إدارة عمليات النقل بين المستودعات",
"warehouse_transfer.empty_status.description": "", "warehouse_transfer.empty_status.description": "غالبًا ماتحتاج الاعمال ذات مستودعات متعددة لطلبات نقل البضائع من مستودع إلى آخر عندما تكون في حاجة ماسة إلى البائعين.",
"item.error.you_could_not_delete_item_has_associated": "لا يمكنك حذف العنصر لديه معاملات مرتبطة به " "item.error.you_could_not_delete_item_has_associated": "لا يمكنك حذف العنصر لديه معاملات مرتبطة به "
} }

View File

@@ -1525,9 +1525,9 @@
"credit_note.label_credit_note": "Credit Note #", "credit_note.label_credit_note": "Credit Note #",
"credit_note.label_amount_to_credit": "Amount to credit", "credit_note.label_amount_to_credit": "Amount to credit",
"credit_note.label_credit_note_details": "Credit Note details", "credit_note.label_credit_note_details": "Credit Note details",
"credit_note.label_customer_note": "Customer note", "credit_note.label_customer_note": "Customer Note",
"credit_note.label_terms_conditions": "Terms conditions", "credit_note.label_terms_conditions": "Terms & Conditions",
"credit_note.label_customer_note.placeholder": "Thanks for your business and have a great day!", "credit_note.label_customer_note.placeholder": "The customer note will be displayed on the credit note.",
"credit_note.label_terms_and_conditions.placeholder": "Enter the terms and conditions of your business to be displayed in your transaction", "credit_note.label_terms_and_conditions.placeholder": "Enter the terms and conditions of your business to be displayed in your transaction",
"credit_note.label_total": "TOTAL", "credit_note.label_total": "TOTAL",
"credit_note.label_subtotal": "Subtotal", "credit_note.label_subtotal": "Subtotal",
@@ -1948,42 +1948,51 @@
"estimate_form.label.total": "TOTAL", "estimate_form.label.total": "TOTAL",
"estimate_form.label.subtotal": "Subtotal", "estimate_form.label.subtotal": "Subtotal",
"estimate_form.label.customer_note": "Customer Note", "estimate_form.label.customer_note": "Customer Note",
"estimate_form.label.terms_conditions": "Terms conditions", "estimate_form.label.terms_conditions": "Terms & Conditions",
"estimate_form.customer_note.placeholder": "Thanks for your business and have a great day!", "estimate_form.customer_note.placeholder": "This message will be displayed on the estimate.",
"estimate_form.terms_and_conditions.placeholder": "Enter the terms and conditions of your business to be displayed in your transaction", "estimate_form.terms_and_conditions.placeholder": "Enter the terms and conditions of your business to be displayed in your transaction",
"invoice_form.label.total": "TOTAL", "invoice_form.label.total": "TOTAL",
"invoice_form.label.subtotal": "Subtotal", "invoice_form.label.subtotal": "Subtotal",
"invoice_form.label.due_amount": "Due amount", "invoice_form.label.due_amount": "Due amount",
"invoice_form.label.payment_amount": "Payment amount", "invoice_form.label.payment_amount": "Payment amount",
"invoice_form.label.invoice_message": "Invoice Message", "invoice_form.label.invoice_message": "Invoice Message",
"invoice_form.invoice_message.placeholder": "Thanks for your business and have a great day!", "invoice_form.label.terms_conditions": "Terms & Conditions",
"invoice_form.terms_and_conditions.placeholder": "Enter the terms and conditions of your business to be displayed in your transaction", "invoice_form.invoice_message.placeholder": "This message will be displayed on the invoice.",
"invoice_form.terms_and_conditions.placeholder": "Enter the terms and conditions of your business to be displayed in your transaction.",
"receipt_form.label.total": "TOTAL", "receipt_form.label.total": "TOTAL",
"receipt_form.label.subtotal": "Subtotal", "receipt_form.label.subtotal": "Subtotal",
"receipt_form.label.due_amount": "Due amount", "receipt_form.label.due_amount": "Due amount",
"receipt_form.label.payment_amount": "Payment amount", "receipt_form.label.payment_amount": "Payment amount",
"receipt_form.label.receipt_message": "Receipt Message", "receipt_form.label.receipt_message": "Receipt Message",
"receipt_form.receipt_message.placeholder": "Thanks for your business and have a great day!", "receipt_form.receipt_message.placeholder": "This message will be displayed on the receipt.",
"receipt_form.label.statement": "Statement", "receipt_form.label.statement": "Statement",
"receipt_form.statement.placeholder": "Thanks for your business and have a great day!", "receipt_form.statement.placeholder": "Thanks for your business and have a great day!",
"payment_receive_form.label.statement": "Statement",
"payment_receive_form.statement.placeholder": "Thanks for your business and have a great day!", "payment_receive_form.label.internal_note": "Internal Note",
"payment_receive_form.internal_note.placeholder": "Internal notes, Not visible to the customer.",
"payment_receive_form.message.label": "Payment Message",
"payment_receive_form.message.placeholder": "This message will be displayed on the payment receipt.",
"payment_receive_form.label.subtotal": "Subtotal", "payment_receive_form.label.subtotal": "Subtotal",
"payment_receive_form.label.total": "TOTAL", "payment_receive_form.label.total": "TOTAL",
"bill_form.label.note": "Note", "bill_form.label.note": "Note",
"bill_form.label.note.placeholder": "Enter the terms and conditions of your business to be displayed in your transaction", "bill_form.label.note.placeholder": "Internal note. Not visible to the vendor.",
"bill_form.label.subtotal": "Subtotal", "bill_form.label.subtotal": "Subtotal",
"bill_form.label.total": "TOTAL", "bill_form.label.total": "TOTAL",
"bill_form.label.due_amount": "Due amount", "bill_form.label.due_amount": "Due amount",
"bill_form.label.payment_amount": "Payment amount", "bill_form.label.payment_amount": "Payment amount",
"vendor_credit_form.label.note": "Note", "vendor_credit_form.label.note": "Note",
"vendor_credit_form.note.placeholder": "Enter the terms and conditions of your business to be displayed in your transaction", "vendor_credit_form.note.placeholder": "Internal note. Not visible to the vendor.",
"vendor_credit_form.label.subtotal": "Subtotal", "vendor_credit_form.label.subtotal": "Subtotal",
"vendor_credit_form.label.total": "TOTAL", "vendor_credit_form.label.total": "TOTAL",
"payment_made_form.label.statement": "Statement", "payment_made_form.label.statement": "Statement",
"payment_made_form.statement.placeholder": "Thanks for your business and have a great day!", "payment_made_form.statement.placeholder": "Thanks for your business and have a great day!",
"payment_made_form.label.subtotal": "Subtotal", "payment_made_form.label.subtotal": "Subtotal",
"payment_made_form.label.total": "TOTAL", "payment_made_form.label.total": "TOTAL",
"payment_made.form.internal_note.label": "Note",
"payment_made.form.internal_note.placeholder": "Internal note. Not visible to the vendor.",
"make_journal.label.subtotal": "Subtotal", "make_journal.label.subtotal": "Subtotal",
"make_journal.label.total": "TOTAL", "make_journal.label.total": "TOTAL",
"expense.label.subtotal": "Subtotal", "expense.label.subtotal": "Subtotal",
@@ -2002,6 +2011,10 @@
"estimate.warehouse_button.label": "Warehouse: {label}", "estimate.warehouse_button.label": "Warehouse: {label}",
"receipt.branch_button.label": "Branch: {label}", "receipt.branch_button.label": "Branch: {label}",
"receipt.warehouse_button.label": "Warehouse: {label}", "receipt.warehouse_button.label": "Warehouse: {label}",
"warehouse_transfer.empty_status.title": "",
"warehouse_transfer.empty_status.description": "" "warehouse_transfer.empty_status.title": "Manage transfer orders between warehouses.",
"warehouse_transfer.empty_status.description": "Business with multiply warehouses often transfers items from on warehouse to another when they are in immediate need of vendors.",
"warehouse_transfer.form.reason.label": "Reason",
"warehouse_transfer.form.reason.placeholder": "Enter the reason behind the transfer order."
} }