mirror of
https://github.com/dyiop/astute.git
synced 2025-04-06 21:30:20 -04:00
Add files via upload
This commit is contained in:
parent
f896706aac
commit
f10e3f323a
|
@ -125,13 +125,13 @@ BEGIN
|
||||||
|
|
||||||
INSERT INTO invoice
|
INSERT INTO invoice
|
||||||
(inv_no,inv_date,PO_num,change_order_num,bill_amt,special_notes,certification,inv_status,pmt_status)
|
(inv_no,inv_date,PO_num,change_order_num,bill_amt,special_notes,certification,inv_status,pmt_status)
|
||||||
(SELECT generated_inv_number, inv_date, PO_num, change_order_num, bill_amt, special_notes, certification, inv_status, pmt_status
|
(SELECT generated_inv_number, CURDATE(), PO_num, change_order_num, bill_amt, special_notes, certification, inv_status, pmt_status
|
||||||
FROM invoice
|
FROM invoice
|
||||||
WHERE inv_no = inv_no_in);
|
WHERE inv_no = inv_no_in);
|
||||||
|
|
||||||
INSERT INTO invoice_detail
|
INSERT INTO invoice_detail
|
||||||
(inv_num,line_item_num,PO_line_item_num,service_type_id,description,qty,fee,fee_type_id)
|
(inv_num,line_item_num,PO_line_item_num,service_type_id,description,qty,fee,fee_type_id)
|
||||||
(SELECT generated_inv_number, line_item_num, PO_line_item_num, service_type_id, description, qty, fee, fee_type_id
|
(SELECT generated_inv_number, line_item_num, PO_line_item_num, service_type_id, description, 0, fee, fee_type_id
|
||||||
FROM invoice_detail
|
FROM invoice_detail
|
||||||
WHERE inv_num = inv_no_in);
|
WHERE inv_num = inv_no_in);
|
||||||
|
|
||||||
|
@ -393,7 +393,7 @@ CREATE TABLE IF NOT EXISTS `po_detail` (
|
||||||
CONSTRAINT `fk_PODetail_ServType` FOREIGN KEY (`service_type_id`) REFERENCES `service_type` (`service_type_id`)
|
CONSTRAINT `fk_PODetail_ServType` FOREIGN KEY (`service_type_id`) REFERENCES `service_type` (`service_type_id`)
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
-- Dumping data for table astute.po_detail: ~11 rows (approximately)
|
-- Dumping data for table astute.po_detail: ~14 rows (approximately)
|
||||||
/*!40000 ALTER TABLE `po_detail` DISABLE KEYS */;
|
/*!40000 ALTER TABLE `po_detail` DISABLE KEYS */;
|
||||||
INSERT INTO `po_detail` (`PO_num`, `line_item_no`, `service_desc`, `fee_type_id`, `qty`, `service_type_id`, `fee`, `remaining_qty`) VALUES
|
INSERT INTO `po_detail` (`PO_num`, `line_item_no`, `service_desc`, `fee_type_id`, `qty`, `service_type_id`, `fee`, `remaining_qty`) VALUES
|
||||||
('EP2649247', 1, 'test', 2, 38073, 1, NULL, NULL),
|
('EP2649247', 1, 'test', 2, 38073, 1, NULL, NULL),
|
||||||
|
@ -402,6 +402,9 @@ INSERT INTO `po_detail` (`PO_num`, `line_item_no`, `service_desc`, `fee_type_id`
|
||||||
('EP2649247', 4, 'test', 2, 880, 4, NULL, NULL),
|
('EP2649247', 4, 'test', 2, 880, 4, NULL, NULL),
|
||||||
('EP2649247', 6, 'test', 2, 456, 1, NULL, NULL),
|
('EP2649247', 6, 'test', 2, 456, 1, NULL, NULL),
|
||||||
('EP2649247', 16, 'test', 1, 1555, 1, NULL, NULL),
|
('EP2649247', 16, 'test', 1, 1555, 1, NULL, NULL),
|
||||||
|
('HRT-16-72046', 1, 'Study existing designs', 1, 100, 1, 50, 100),
|
||||||
|
('HRT-16-72046', 2, 'Design Phase', 1, 100, 2, 100, 100),
|
||||||
|
('HRT-16-72046', 3, 'Cost Estimation', 1, 100, 4, 100, 100),
|
||||||
('Real PO 123', 1, 'Real PO 123 lineitem1', 1, 10000, 1, 500, NULL),
|
('Real PO 123', 1, 'Real PO 123 lineitem1', 1, 10000, 1, 500, NULL),
|
||||||
('Real PO 123', 2, 'Real PO 123 - lineitem 2', 1, 1000, 1, 50, 1000),
|
('Real PO 123', 2, 'Real PO 123 - lineitem 2', 1, 1000, 1, 50, 1000),
|
||||||
('Real PO 123', 3, 'Real PO 123 - lineitem 3', 1, 1000, 1, 50, 1000),
|
('Real PO 123', 3, 'Real PO 123 - lineitem 3', 1, 1000, 1, 50, 1000),
|
||||||
|
@ -457,9 +460,9 @@ else
|
||||||
set po_no = po_no_in;
|
set po_no = po_no_in;
|
||||||
end if;
|
end if;
|
||||||
|
|
||||||
select po_detail.qty - sum(invoice_detail.qty) into rem_qty from invoice_detail, invoice, po_detail
|
select po_detail.qty - ifnull(sum(invoice_detail.qty),0) into rem_qty from invoice_detail, invoice, po_detail
|
||||||
where invoice_detail.inv_num in (select inv_num from invoice where invoice.PO_num = po_no)
|
where invoice_detail.inv_num in (select inv_no from invoice where invoice.PO_num = po_no)
|
||||||
and invoice_detail.po_line_item_num = inv_num_in
|
and invoice_detail.po_line_item_num = item_no_in
|
||||||
and po_detail.PO_num = po_no
|
and po_detail.PO_num = po_no
|
||||||
and invoice.PO_num = po_detail.PO_num
|
and invoice.PO_num = po_detail.PO_num
|
||||||
and invoice.inv_no = invoice_detail.inv_num
|
and invoice.inv_no = invoice_detail.inv_num
|
||||||
|
|
Loading…
Reference in New Issue
Block a user