Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Populated CBO name from WO on creation of purchase bill + react-component-error-fix #647

Merged
merged 2 commits into from
Sep 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"@egovernments/digit-ui-module-estimate": "0.4.5",
"@egovernments/digit-ui-module-masters": "0.4.5",
"@egovernments/digit-ui-module-project": "0.4.1",
"@egovernments/digit-ui-module-expenditure": "0.4.1",
"@egovernments/digit-ui-module-expenditure": "0.4.2",
"@egovernments/digit-ui-customisation-mukta": "0.2.1",
"@egovernments/digit-ui-module-rate-analysis": "0.4.0",
"http-proxy-middleware": "^1.0.5",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
{
"name": "@egovernments/digit-ui-module-expenditure",
"version": "0.4.1",
"description": "Expenditure Management Module UI",
"main": "dist/index.js",
"module": "dist/index.modern.js",
"source": "src/Module.js",
"files": [
"dist"
],
"scripts": {
"start": "microbundle-crl watch --no-compress --format modern,cjs",
"build": "microbundle-crl --compress --no-sourcemap --format cjs",
"prepublish": "yarn build"
},
"peerDependencies": {
"react": "17.0.2",
"react-router-dom": "5.3.0"
},
"dependencies": {
"@egovernments/digit-ui-react-components": "^1.5.0",
"lodash": "^4.17.21",
"react": "17.0.2",
"react-date-range": "^1.4.0",
"react-dom": "17.0.2",
"react-hook-form": "6.15.8",
"react-i18next": "11.16.2",
"react-query": "3.6.1",
"react-router-dom": "5.3.0"
},
"author": "",
"license": "MIT"
}
"name": "@egovernments/digit-ui-module-expenditure",
"version": "0.4.2",
"description": "Expenditure Management Module UI",
"main": "dist/index.js",
"module": "dist/index.modern.js",
"source": "src/Module.js",
"files": [
"dist"
],
"scripts": {
"start": "microbundle-crl watch --no-compress --format modern,cjs",
"build": "microbundle-crl --compress --no-sourcemap --format cjs",
"prepublish": "yarn build"
},
"peerDependencies": {
"react": "17.0.2",
"react-router-dom": "5.3.0"
},
"dependencies": {
"@egovernments/digit-ui-react-components": "^1.5.0",
"lodash": "^4.17.21",
"react": "17.0.2",
"react-date-range": "^1.4.0",
"react-dom": "17.0.2",
"react-hook-form": "6.15.8",
"react-i18next": "11.16.2",
"react-query": "3.6.1",
"react-router-dom": "5.3.0"
},
"author": "",
"license": "MIT"
}
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,46 @@ const CreatePurchaseBillForm = ({
setValue("billDetails_billAmt", parseInt(formData.invoiceDetails_materialCost)+parseInt(gstAmount));
}

if(difference?.invoiceDetails_organisationType)
{
if (formData?.invoiceDetails_organisationType?.code === "CBO") {
setValue("invoiceDetails_vendor", contract.additionalDetails?.cboName);
setValue("invoiceDetails_vendorId", contract.additionalDetails?.cboOrgNumber);

const organizationDetailsSection = createPurchaseBillConfig.form.find(item => item.head === "EXP_ORGANIZATION_DETAILS");

if (organizationDetailsSection) {
const vendorField = organizationDetailsSection.body.find(item => item.key === "invoiceDetails_vendor");

if (vendorField) {
// Disabling and converting the field to text input
vendorField.disable = true;
vendorField.type = "text";
vendorField.populators.customClass = "disabled-text-field";
}
}
} else {
setValue("invoiceDetails_vendor", '');
setValue("invoiceDetails_vendorId", undefined);
setValue("invoiceDetails_vendorId", '');

const organizationDetailsSection = createPurchaseBillConfig.form.find(item => item.head === "EXP_ORGANIZATION_DETAILS");

if (organizationDetailsSection) {
const vendorField = organizationDetailsSection.body.find(item => item.key === "invoiceDetails_vendor");

if (vendorField) {
// Enabling and converting back to dropdown
vendorField.disable = false;
vendorField.type = "dropdown";
vendorField.populators.customClass = undefined;
}
}
}


// if(difference?.invoiceDetails_organisationType)
// {
// setValue("invoiceDetails_vendor", '');
// setValue("invoiceDetails_vendorId", undefined);
// }

if(formData.billDetails_billAmt) {
let gstAmount = formData.invoiceDetails_gst ? formData.invoiceDetails_gst : 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const CitizenInfoLabel = (props) => {
const showInfo = props?.showInfo ? props?.showInfo : true;

return (
<div className={`info-banner-wrap ${props?.className ?? ""}`} style={props?.style}>
<div className={`info-banner-wrap ${props?.className ? "":""}`} style={props?.style}>
{showInfo && (
<div>
<InfoBannerIcon fill={props?.fill} />
Expand Down
2 changes: 1 addition & 1 deletion frontend/micro-ui/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"@egovernments/digit-ui-module-estimate": "0.4.5",
"@egovernments/digit-ui-module-masters": "0.4.5",
"@egovernments/digit-ui-module-project": "0.4.1",
"@egovernments/digit-ui-module-expenditure": "0.4.1",
"@egovernments/digit-ui-module-expenditure": "0.4.2",
"@egovernments/digit-ui-customisation-mukta": "0.2.1",
"@egovernments/digit-ui-module-rate-analysis": "0.4.0",
"babel-loader": "8.1.0",
Expand Down
Loading