TariqMehmod
Programmer
Dear Experts
I am working on 30 Days Trade Credit and refer to these links
In short:
Net 30 refers to the trade credit offered to a customer for the sale of goods or services.
Net 30 means that if the amount due is paid within 30 days, the customer will enjoy a 5% discount.
I have this data
[pre]
* Invoice Table
CREATE CURSOR invoice(no n(4),date d(8),amount n(5),due d(8),discount n(5))
INSERT INTO invoice values(1,CTOD('01/04/2019'),1500,CTOD('01/05/2019'),0)
INSERT INTO invoice values(1,CTOD('15/04/2019'),2500,CTOD('15/05/2019'),0)
INSERT INTO invoice values(1,CTOD('28/04/2019'),1800,CTOD('28/05/2019'),0)
* recovery Table
CREATE CURSOR recovery(no n(4),date d(8),amount n(5))
INSERT INTO recovery VALUES (1, CTOD('03/04/2019'), 300)
INSERT INTO recovery VALUES (2, CTOD('05/04/2019'), 800)
INSERT INTO recovery VALUES (3, CTOD('30/04/2019'), 400)
INSERT INTO recovery VALUES (4, CTOD('01/05/2019'), 400)
INSERT INTO recovery VALUES (5, CTOD('08/05/2019'), 300)
INSERT INTO recovery VALUES (6, CTOD('10/05/2019'), 500)
INSERT INTO recovery VALUES (7, CTOD('12/05/2019'), 100)
INSERT INTO recovery VALUES (8, CTOD('15/05/2019'), 600)
INSERT INTO recovery VALUES (9, CTOD('17/05/2019'), 800)
INSERT INTO recovery VALUES (10,CTOD('18/05/2019'), 100)
INSERT INTO recovery VALUES (11,CTOD('19/05/2019'), 300)
INSERT INTO recovery VALUES (12,CTOD('22/05/2019'), 400)
[/pre]
More Explanation:
Conclusion:
If an Invoice gets recovery within due date then
I want to fill discount column in invoice table like shown in above image
Please help
I am working on 30 Days Trade Credit and refer to these links
In short:
Net 30 refers to the trade credit offered to a customer for the sale of goods or services.
Net 30 means that if the amount due is paid within 30 days, the customer will enjoy a 5% discount.
I have this data
[pre]
* Invoice Table
CREATE CURSOR invoice(no n(4),date d(8),amount n(5),due d(8),discount n(5))
INSERT INTO invoice values(1,CTOD('01/04/2019'),1500,CTOD('01/05/2019'),0)
INSERT INTO invoice values(1,CTOD('15/04/2019'),2500,CTOD('15/05/2019'),0)
INSERT INTO invoice values(1,CTOD('28/04/2019'),1800,CTOD('28/05/2019'),0)
* recovery Table
CREATE CURSOR recovery(no n(4),date d(8),amount n(5))
INSERT INTO recovery VALUES (1, CTOD('03/04/2019'), 300)
INSERT INTO recovery VALUES (2, CTOD('05/04/2019'), 800)
INSERT INTO recovery VALUES (3, CTOD('30/04/2019'), 400)
INSERT INTO recovery VALUES (4, CTOD('01/05/2019'), 400)
INSERT INTO recovery VALUES (5, CTOD('08/05/2019'), 300)
INSERT INTO recovery VALUES (6, CTOD('10/05/2019'), 500)
INSERT INTO recovery VALUES (7, CTOD('12/05/2019'), 100)
INSERT INTO recovery VALUES (8, CTOD('15/05/2019'), 600)
INSERT INTO recovery VALUES (9, CTOD('17/05/2019'), 800)
INSERT INTO recovery VALUES (10,CTOD('18/05/2019'), 100)
INSERT INTO recovery VALUES (11,CTOD('19/05/2019'), 300)
INSERT INTO recovery VALUES (12,CTOD('22/05/2019'), 400)
[/pre]
More Explanation:
Conclusion:
If an Invoice gets recovery within due date then
I want to fill discount column in invoice table like shown in above image
Please help