I have a workbook i.e. Hundi Payment.xlsm in which we maintain list of invoices which has Hundi Payment Term and the file also contains numerous details related to such invoices like invoice number, date, supplier id, GRN etc
I have 2nd workbook i.e. Imprest Report.xlsx which contains all such invoices as aforementioned as well all their associated invoices, deductions and other invoices as well which have different payment terms.
Then there is a 3rd workbook i.e. RBL Payment.xlsx, which needs to be prepared using both the above workbooks wherein I need to put invoice wise details from workbook 1 and their associated invoices or deductions from workbook 2 in worksheet "Details" of workbook3 and summarize this details in "Details" worksheet and put it in worksheet "Summary" in workbook3.
I am trying to figure out VBA code to put one invoice detail at a time from workbook 1 to workbook 3 and then only find all the associated invoices or deductions from workbook 2 and if found put those in workbook 3 if not found then ignore it and then proceed for 2nd invoice and so on.
We need to find the details in workbook 2 of the invoices mentioned in workbook 1 with a criteria that it pertains to the same supplier id and to identify the associated invoices or deduction it has this pattern i.e. Invoice Number-Some Suffix.
Please help. If you have any query please let me know.
Workbook1
Workbook2
Workbook3 Worksheet("Details")
Workbook3 Worksheet("Summary")
I have 2nd workbook i.e. Imprest Report.xlsx which contains all such invoices as aforementioned as well all their associated invoices, deductions and other invoices as well which have different payment terms.
Then there is a 3rd workbook i.e. RBL Payment.xlsx, which needs to be prepared using both the above workbooks wherein I need to put invoice wise details from workbook 1 and their associated invoices or deductions from workbook 2 in worksheet "Details" of workbook3 and summarize this details in "Details" worksheet and put it in worksheet "Summary" in workbook3.
I am trying to figure out VBA code to put one invoice detail at a time from workbook 1 to workbook 3 and then only find all the associated invoices or deductions from workbook 2 and if found put those in workbook 3 if not found then ignore it and then proceed for 2nd invoice and so on.
We need to find the details in workbook 2 of the invoices mentioned in workbook 1 with a criteria that it pertains to the same supplier id and to identify the associated invoices or deduction it has this pattern i.e. Invoice Number-Some Suffix.
Please help. If you have any query please let me know.
Workbook1
GRN | Receipt Date | Org | Supplier Name | Supplier Code | PO No. | Item Code | Item Description | Type | Invoice No. | Invoice Date | Receipt Qty | Challan Qty | Gross Amount | SGST | CGST | IGST | Net Amount | Freight | Discount | Others | Amount Paid | Currency | Exchange Rate | GRN exchange rate | Payment Terms | GRN Currency | Material Status | Invoiced | Invoice Number | Voucher Number | Source | Validation Status | G L Date | AP Period | Due Date | Date Invoice Received | Vendor Type | With this date hundi should be done | Due Date | Bills Should Be Passed By | Tenor | Vendor | GR | Bill No | Approx Amt | Passed Amt | Voucher No. | Remarks | request sent to bank on | FY |
21940 | 24-May-23 | My Org:110 | ABC | 1862 | 291999 | A | Material A | RM | MUMV03626 | 22-05-2023 00:00 | 10000 | 10000 | 390000 | 35100 | 35100 | 0 | 460200 | INR | 15 | 15 days Hundi payment 60 days tenure thru RTGS | 60 | Delivered | Y | MUMV03626 | 152319 | Manual Invoice Entry | Validated | 26-May-23 | May-23 | 08-Jun-23 | RM-INDIGENOUS | 08-Jun-23 | 27-07-2023 | 10 | 60 | ABC | 21940 | MUMV03626 | 460200 | 460200 | 152319 | #N/A | 2022-23 | |||||||
21883 | 20-May-23 | My Org:110 | XYZ | 18852 | 283065 | B | Material B | PKG | PC/0129/23-24 | 19-05-2023 00:00 | 1760 | 1760 | 157643.2 | 14187.89 | 14187.89 | 0 | 186018.98 | 0 | INR | 15 | MSME - RTGS -15 days Hundi payment 60 days tenure | 60 | Delivered | Y | PC/0129/23-24 | 152161 | ERS | Validated | 20-May-23 | May-23 | 04-Jun-23 | 45066 | RM-INDIGENOUS | 04-Jun-23 | 27-07-2023 | 6 | 60 | XYZ | 21883 | PC/0129/23-24 | 186018.98 | 186018.98 | 152161 | #N/A | 2022-23 | |||||
21907 | 22-May-23 | My Org:110 | BCD | 1860 | 295206 | C | Material C | RM | NH/54/23-24 | 16-05-2023 00:00 | 24720 | 24720 | 2348400 | 0 | 0 | 422712 | 2771112 | INR | 20 | MSME - RTGS - 20 days Hundi payment 60 days tenure | 60 | Pending Delivery | Y | NH/54/23-24 | 152307 | Manual Invoice Entry | Validated | 26-May-23 | May-23 | 06-Jun-23 | RM-INDIGENOUS | 11-Jun-23 | 27-07-2023 | 13 | 60 | BCD | 21907 | NH/54/23-24 | 2771112 | 2771112 | 152307 | |||||||||
21916 | 23-May-23 | My Org:110 | CDE | 1715 | 297290 | D | Material D | RM | 1667851298 | 20-05-2023 00:00 | 35000 | 35000 | 304500 | 0 | 0 | 15225 | 319725 | INR | 15 | 15 days Hundi payment 60 days tenure thru RTGS | 60 | Delivered | Y | 1.668E+09 | 152314 | Manual Invoice Entry | Validated | 26-May-23 | May-23 | 07-Jun-23 | RM-INDIGENOUS | 07-Jun-23 | 27-07-2023 | 9 | 60 | CDE | 21916 | 1667851298 | 319725 | 319725 | 152314 | |||||||||
21883 | 20-May-23 | My Org:110 | XYZ | 18852 | 283065 | E | Material E | PKG | PC/0129/23-24 | 19-05-2023 00:00 | 2600 | 2600 | 125658 | 11309.22 | 11309.22 | 0 | 148276.44 | 0 | INR | 15 | MSME - RTGS -15 days Hundi payment 60 days tenure | 60 | Delivered | Y | PC/0129/23-24 | 152161 | ERS | Validated | 20-May-23 | May-23 | 04-Jun-23 | 45066 | RM-INDIGENOUS | 04-Jun-23 | 27-07-2023 | 6 | 60 | XYZ | 21883 | PC/0129/23-24 | 148276.44 | 148276.44 | 152161 | |||||||
21729 | 15-May-23 | My Org:110 | BCD | 1860 | 295206 | C | Material C | RM | NH/46/23-24 | 09-05-2023 00:00 | 15972 | 15972 | 1517340 | 0 | 0 | 273121.2 | 1790461.2 | INR | 20 | MSME - RTGS - 20 days Hundi payment 60 days tenure | 60 | Delivered | Y | NH/46/23-24 | 151638 | Manual Invoice Entry | Validated | 18-May-23 | May-23 | 30-May-23 | RM-INDIGENOUS | 04-Jun-23 | 27-07-2023 | 6 | 60 | BCD | 21729 | NH/46/23-24 | 1790461.2 | 1790461.2 | 151638 | |||||||||
20427 | 23-Feb-23 | My Org:110 | ABC | 1862 | 281420 | F | Material F | RM | MUMV15889 | 21-02-2023 00:00 | 100 | 100 | 39000 | 3510 | 3510 | 0 | 46020 | INR | 15 | 15 days Hundi payment 60 days tenure thru RTGS | 60 | Delivered | Y | MUMV15889 | 147330 | Manual Invoice Entry | Validated | 31-Mar-23 | Mar-23 | 10-Mar-23 | RM-INDIGENOUS | 10-Mar-23 | 27-07-2023 | -80 | 60 | ABC | 20427 | MUMV15889 | 46020 | 46020 | 147330 | |||||||||
Workbook2
REGN | DEPOT | PERIOD | Created by | VOUCHER NUMBER | Cheque Number | Cheque Date | Account Number | Supplier Id | Supplier Site | TDS Section | TDS Percentage | TRADING PARTNER | INVOICE NUMBER | INVOICE DATE | ACCOUNT | Account Name | AMOUNT | HDR DESCRIPTION | DIST DESCRIPTION | Attribute 4 | PID CODE | PID NAME | PID CATEGORY |
W1 | 380:Jejuri - Mfg | May-23 | 380-ACCOUNTANT | 152319 | ' | 1862 | Mumbai | SEC. 194(Q) | 0.1 | ABC | MUMV03626 | 22-May-23 | 380.380.000.26206.10.000000 | Accrued A/c Payables | 390000 | BASOFIX T | |||||||
W1 | 380:Jejuri - Mfg | May-23 | 380-ACCOUNTANT | 152319 | ' | 1862 | Mumbai | SEC. 194(Q) | 0.1 | ABC | MUMV03626 | 22-May-23 | 380.380.000.26206.10.000000 | Accrued A/c Payables | 35100 | CGST_REC_STANDARD | |||||||
W1 | 380:Jejuri - Mfg | May-23 | 380-ACCOUNTANT | 152319 | ' | 1862 | Mumbai | SEC. 194(Q) | 0.1 | ABC | MUMV03626 | 22-May-23 | 380.380.000.26206.10.000000 | Accrued A/c Payables | 35100 | SGST_REC_STANDARD | |||||||
W1 | 380:Jejuri - Mfg | May-23 | 380-ACCOUNTANT | 152324 | ' | 1862 | Mumbai | ABC | MUMV03626-TDS-CM-1267094 | 22-May-23 | 009.000.000.26722.10.000000 | TDS - 194 Q | -390 | MUMV03626-TDS-CM-1267094 | MUMV03626-TDS-CM-1267094/TDS/SEC. 194(Q)/TDS_TYPE/230522/.1 | ||||||||
Workbook3 Worksheet("Details")
Document Number | Document Date | Document CCY | Document Amt | Other Deduction | Amount Deductable | Net Amount | Shipment Date | Financing Tenor Start Date | Financing Tenor | Maturity Date | Supplier Id | Supplier Name | Buyer Name | Goods Desc | Country Of Origin | Shipment From | Shipment from Country | Shipment To | Shipment to Country |
MUMV03626 | 22-05-2023 | INR | 4,60,200.00 | 4,60,200.00 | 22-05-2023 | 29-05-2023 | 60 | 28-07-2023-Friday | 1862 | ABC | XXX | CHEMICALS, CONTAINER | IN | INDIA | IN | INDIA | IN | ||
MUMV03626-TDS-CM-1267094 | 22-05-2023 | INR | -390.00 | -390.00 | 22-05-2023 | 29-05-2023 | 60 | 28-07-2023-Friday | 1862 | ABC | XXX | CHEMICALS, CONTAINER | IN | INDIA | IN | INDIA | IN | ||
Workbook3 Worksheet("Summary")
Beneficiary (Vendor) | ERP ID | Tenor | Total Invoice Amount (Rs.) | Interest (Rs.) @18% | Net Amount Payable (Rs.) | Due Date | Beneficiary Bank Name & Address | Account Number | IFSC Code |
ABC | 1862 | 60 | 4,59,810.00 | 13,605.34 | 4,46,204.66 | 28-Jul-23 | BOB | xxxxxxx45 | xxxxxx12 |
4,59,810.00 | 34,782.57 | 4,46,204.66 | |||||||