Fixed defects.

This commit is contained in:
gopi17701 2019-01-10 10:44:56 -05:00
parent 54bf16b42d
commit d76671f0ca
17 changed files with 3972 additions and 3811 deletions

View File

@ -1,5 +1,6 @@
<app-nav-bar [customerActive]="true"></app-nav-bar> <app-nav-bar [customerActive]="true"></app-nav-bar>
<h1 align="center">Customers</h1> <h1 align="center">Customers</h1>
<div class="container-fluid"> <div class="container-fluid">
<div class="row"> <div class="row">
<div class="col-12"> <div class="col-12">
@ -12,6 +13,7 @@
[rowData]="rowData | async" [rowData]="rowData | async"
[columnDefs]="columnDefs" [columnDefs]="columnDefs"
rowSelection="single" rowSelection="single"
rowDeselection="true"
></ag-grid-angular> ></ag-grid-angular>
</div> </div>
</div> </div>
@ -139,7 +141,7 @@
<button class="btn btn-success" type="button" <button class="btn btn-success" type="button"
[disabled]="!(inId.value && inName.value && inBillToDept.value && inAdd1.value && inCity.value && inState.value && inZIP.value && inEmail.value && inPhone.value && inFax.value)" [disabled]="!(inId.value && inName.value && inBillToDept.value && inAdd1.value && inCity.value && inState.value && inZIP.value && inEmail.value && inPhone.value && inFax.value)"
(click)="addCustomer(inId.value, inName.value, inBillToDept.value, inAdd1.value, inAdd2.value, inCity.value, inState.value, inZIP.value, inZIP4.value, inEmail.value, inPhone.value, inFax.value, new)"> (click)="addCustomer(inId.value, inName.value, inBillToDept.value, inAdd1.value, inAdd2.value, inCity.value, inState.value, inZIP.value, inZIP4.value, inEmail.value, inPhone.value, inFax.value, new)">
+ Add
</button> </button>
<button type="button" class="btn btn-danger" (click)="close(new)">Cancel</button> <button type="button" class="btn btn-danger" (click)="close(new)">Cancel</button>
</div> </div>

View File

@ -0,0 +1 @@
/* Empty file */

View File

@ -50,8 +50,8 @@
<td style="width: 10%"> <td style="width: 10%">
<span class="input-group-text">Payment Received*</span> <span class="input-group-text">Payment Received*</span>
</td> </td>
<td colspan="7"> <td class="p-0 m-0" colspan="7">
<input type="text" class="form-control" placeholder="$00.00" #inPaymentReceived> <input type="text" class="form-control cell" [value]="0 | currency" #inPaymentReceived>
</td> </td>
</tr> </tr>
@ -78,6 +78,15 @@
</td> </td>
</tr> </tr>
<tr>
<td style="width: 10%">
<span class="input-group-text">Check# / ACH transaction#*</span>
</td>
<td colspan="7">
<input type="text" class="form-control" #incheckTransactionNo>
</td>
</tr>
</tbody> </tbody>
</table> </table>
</div> </div>
@ -85,8 +94,9 @@
<div class="modal-footer"> <div class="modal-footer">
<button class="btn btn-success" type="button" <button class="btn btn-success" type="button"
[disabled]="!(chosenInv && inPaymentReceived.value && chosenPaymentType && inDateReceived.value)" [disabled]="!(chosenInv && inPaymentReceived.value && chosenPaymentType && inDateReceived.value)"
(click)="addInvoicePayment(chosenInv, null, chosenPaymentType, null, inDateReceived.value, inPaymentReceived.value, new)"> (click)="addInvoicePayment(chosenInv, null, chosenPaymentType, inDateReceived.value, inPaymentReceived.value.replace('$', '').replace(',', ''), incheckTransactionNo.value,new)">
+ <!--(click)="addInvoicePayment(chosenInv, null, chosenPaymentType, null, inDateReceived.value, inPaymentReceived.value, new)">-->
Add
</button> </button>
<!--<input type="reset" (click)="close(new)">Cancel--> <!--<input type="reset" (click)="close(new)">Cancel-->
<button type="reset" class="btn btn-danger" (click)="close(new)">Cancel</button> <button type="reset" class="btn btn-danger" (click)="close(new)">Cancel</button>
@ -118,6 +128,21 @@
</td> </td>
</tr> </tr>
<tr>
<td style="width: 10%">
<span class="input-group-text">Payment Type*</span>
</td>
<td>
<input type="text" class="form-control" #paymentTypeSelect [value]="paymentTypes[selected.paymentTypeId-1].paymentTypeName">
<!--<select class="custom-select" [value]={{paymentTypes[selected.paymentTypeId-1].paymentTypeName}} (change)="paymentTypeDropdownChange(paymentTypeSelect.value)"-->
<!--#paymentTypeSelect>-->
<!--<option *ngFor="let paymentType of paymentTypes; let i = index;" [value]="i">{{paymentType.paymentTypeName}}-->
<!--&lt;!&ndash;{{paymentTypes[selected.paymentTypeId-1].paymentTypeName}}}&ndash;&gt;-->
<!--</option>-->
<!--</select>-->
</td>
</tr>
<tr> <tr>
<td style="width: 10%"> <td style="width: 10%">
<span class="input-group-text">Date Received*</span> <span class="input-group-text">Date Received*</span>
@ -126,13 +151,23 @@
<input type="date" class="form-control" #inDateReceived [value]="selected.paymentDate"> <input type="date" class="form-control" #inDateReceived [value]="selected.paymentDate">
</td> </td>
</tr> </tr>
<tr>
<td style="width: 10%">
<span class="input-group-text">Check# / ACH transaction#*</span>
</td>
<td colspan="7">
<input type="text" class="form-control" #incheckTransactionNo [value]="selected.checkTransactionNo">
</td>
</tr>
</tbody> </tbody>
</table> </table>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button class="btn btn-warning" type="button" <button class="btn btn-warning" type="button"
[disabled]="!(invoiceSelect.value && inPaymentReceived.value && inDateReceived.value)" [disabled]="!(invoiceSelect.value && inPaymentReceived.value && inDateReceived.value && incheckTransactionNo)"
(click)="updateInvoicePayment(invoiceSelect.value, selected.invoicePaymentId, selected.paymentTypeId, selected.paymentType, inDateReceived.value, inPaymentReceived.value, edit)"> (click)="updateInvoicePayment(invoiceSelect.value, selected.invoicePaymentId, selected.paymentTypeId, inDateReceived.value, inPaymentReceived.value.substr(1).replace(',', ''), incheckTransactionNo.value, edit)">
Update Update
</button> </button>
<button type="button" class="btn btn-danger" (click)="close(edit)">Cancel</button> <button type="button" class="btn btn-danger" (click)="close(edit)">Cancel</button>

View File

@ -21,7 +21,9 @@ export class InvoicePaymentComponent implements OnInit {
{headerName: 'Invoice Number', field: 'invoiceNum'}, {headerName: 'Invoice Number', field: 'invoiceNum'},
{headerName: 'Payment Received', field: 'invoiceAmount'}, {headerName: 'Payment Received', field: 'invoiceAmount'},
{headerName: 'Date Received', field: 'paymentDate'}, {headerName: 'Date Received', field: 'paymentDate'},
{headerName: 'Payment Type', field: 'paymentType'} {headerName: 'Payment Type', field: 'paymentType'},
{headerName: 'Check / ACH Transaction #', field: 'checkTransactionNo'}
]; ];
constructor(protected astuteClientService: AstuteClientService) { constructor(protected astuteClientService: AstuteClientService) {
@ -48,14 +50,14 @@ export class InvoicePaymentComponent implements OnInit {
} }
} }
addInvoicePayment(invoiceNum, invoicePaymentId, paymentTypeId, paymentType, paymentDate, paymentReceived, ref) { addInvoicePayment(invoiceNum, invoicePaymentId, paymentTypeId, paymentDate, paymentReceived, checkTransactionNo, ref) {
let invoicePaymentData = { let invoicePaymentData = {
"invoiceNum": invoiceNum, "invoiceNum": invoiceNum,
"invoicePaymentId":invoicePaymentId, "invoicePaymentId":invoicePaymentId,
"paymentTypeId":paymentTypeId, "paymentTypeId":paymentTypeId,
"paymentType": paymentType,
"paymentDate": paymentDate, "paymentDate": paymentDate,
"invoiceAmount": paymentReceived "invoiceAmount": paymentReceived,
"checkTransactionNo": checkTransactionNo
}; };
this.astuteClientService.addInvoicePayment(invoicePaymentData).then((data) => { this.astuteClientService.addInvoicePayment(invoicePaymentData).then((data) => {
if (data) { if (data) {
@ -69,14 +71,14 @@ export class InvoicePaymentComponent implements OnInit {
}); });
} }
updateInvoicePayment(invoiceNum, invoicePaymentId, paymentTypeId, paymentType, dateReceived, paymentReceived, ref) { updateInvoicePayment(invoiceNum, invoicePaymentId, paymentTypeId, dateReceived, paymentReceived, checkTransactionNo, ref) {
const invoicePaymentData = { const invoicePaymentData = {
"invoiceNum": invoiceNum, "invoiceNum": invoiceNum,
"invoicePaymentId": invoicePaymentId, "invoicePaymentId": invoicePaymentId,
"paymentTypeId": paymentTypeId, "paymentTypeId": paymentTypeId,
"paymentType": paymentType,
"paymentDate": dateReceived, "paymentDate": dateReceived,
"invoiceAmount": paymentReceived "invoiceAmount": paymentReceived,
"checkTransactionNo": checkTransactionNo
}; };
this.astuteClientService.updateInvoicePayment(invoiceNum, invoicePaymentId, invoicePaymentData).then((data) => { this.astuteClientService.updateInvoicePayment(invoiceNum, invoicePaymentId, invoicePaymentData).then((data) => {

View File

@ -21,11 +21,6 @@
<!--Buttons--> <!--Buttons-->
<div class="row justify-content-center mt-2"> <div class="row justify-content-center mt-2">
<div class="col-2">
<button class="btn btn-light" style="width: 100%" (click)="assignActity()" [disabled]="!chosenInv">
Print
</button>
</div>
<div class="col-2"> <div class="col-2">
<button class="btn btn-primary" style="width: 100%" (click)="submitInvoice(chosenInv.invoiceNumber)" [disabled]="!(chosenInv && chosenInv.invoiceStatus === 1)"> <button class="btn btn-primary" style="width: 100%" (click)="submitInvoice(chosenInv.invoiceNumber)" [disabled]="!(chosenInv && chosenInv.invoiceStatus === 1)">
Submit Submit
@ -42,15 +37,21 @@
</button> </button>
</div> </div>
<div class="col-2"> <div class="col-2">
<button class="btn btn-info" style="width: 100%" (click)="open(edit)" [disabled]="!chosenInv"> <button class="btn btn-info" style="width: 100%" (click)="open(edit,null,null)" [disabled]="!chosenInv">
Edit Edit
</button> </button>
</div> </div>
<div class="col-2"> <div class="col-2">
<button class="btn btn-success" style="width: 100%" (click)="open(new)"> <button class="btn btn-success" style="width: 100%" (click)="open(new,null,null)">
Add Add
</button> </button>
</div> </div>
<div class="col-2">
<!--<button class="btn btn-light" style="width: 100%" (click)="assignActity()" [disabled]="!chosenInv">-->
<button class="btn btn-light" style="width: 100%" (click)="assignActity()" disabled>
Print
</button>
</div>
</div> </div>
</div> </div>
@ -67,13 +68,14 @@
<span class="input-group-text">Customer </span> <span class="input-group-text">Customer </span>
</td> </td>
<td> <td>
<select class="custom-select" (change)="customerDropdownChange(customerSelec.value)" <input type="text" class="form-control" [value]=chosenInv.customerId disabled>
#customerSelec disabled> <!--<select class="custom-select" (change)="customerDropdownChange(chosenInv.customerId)"-->
<!--[value]="chosenInv.customerName"--> <!--#customerSelec disabled>-->
<option [value]="-1">Choose Customer...</option> <!--[value]="chosenInv.customerId"-->
<option *ngFor="let customer of customers; let i = index;" [value]="i">{{customer.customerName}} <!--<option [value]="-1">Choose Customer...</option>-->
</option> <!--<option *ngFor="let customer of customers; let i = index;" [value]="i">{{customer.customerName}}-->
</select> <!--</option>-->
<!--</select>-->
</td> </td>
<td style="width: 5%"></td> <td style="width: 5%"></td>
<td style="width: 10%"> <td style="width: 10%">
@ -128,10 +130,11 @@
<span class="input-group-text">Payment Status*</span> <span class="input-group-text">Payment Status*</span>
</td> </td>
<td> <td>
<select class="custom-select" [value]="chosenInv.pmtStatus" #pmtStatusIn> <input type="text" class="form-control" [value]=chosenInv.pmtStatusDesc disabled>
<option value=0>Not Paid</option> <!--<select class="custom-select" [value]="chosenInv.pmtStatus" #pmtStatusIn disabled>-->
<option value=1>Paid</option> <!--<option value="Outstanding">"Outstanding"</option>-->
</select> <!--<option value="Paid">"Paid"</option>-->
<!--</select>-->
</td> </td>
</tr> </tr>
</tbody> </tbody>
@ -156,7 +159,7 @@
<!--<span class="input-group-text">Payment Status*</span>--> <!--<span class="input-group-text">Payment Status*</span>-->
<!--</div>--> <!--</div>-->
<!--<select class="custom-select" [value]="chosenInv.pmtStatus" #pmtStatusIn>--> <!--<select class="custom-select" [value]="chosenInv.pmtStatus" #pmtStatusIn>-->
<!--<option value=0>Not Paid</option>--> <!--<option value=0>Outstanding</option>-->
<!--<option value=1>Paid</option>--> <!--<option value=1>Paid</option>-->
<!--</select>--> <!--</select>-->
<!--</div>--> <!--</div>-->
@ -189,31 +192,31 @@
</td> </td>
<td class="p-0 m-0"><input type="text" class="form-control cell" [value]="feeTypes[inDet.feeTypeId - 1]" <td class="p-0 m-0"><input type="text" class="form-control cell" [value]="feeTypes[inDet.feeTypeId - 1]"
disabled></td> disabled></td>
<td class="p-0 m-0"><input type="text" class="form-control cell" [value]="inDet.fee | currency" #fee disabled> <td class="p-0 m-0"><input type="text" class="form-control cell" [value]="inDet.fee | currency" #fee [disabled]="chosenInv.invoiceStatus !== 1"
<!--(change)="onSelectedCellChange(i, 'fee', fee.value); updateSelectedBillAmt()" --> (change)="onSelectedCellChange(i, 'fee', fee.value.substr(1)); updateSelectedBillAmt()">
</td> </td>
<td class="p-0 m-0"><input type="number" class="form-control cell" [value]="inDet.qty" <td class="p-0 m-0"><input type="number" class="form-control cell" [value]="inDet.qty"
[step]="inDet.remainingQty / 100" [step]="inDet.remainingQty / 100"
(change)="onSelectedCellChange(i, 'qty', qty.value); updateSelectedBillAmt()" #qty [disabled]="chosenInv.invoiceStatus !== 1"> (change)="onSelectedCellChange(i, 'qty', qty.value); updateSelectedBillAmt()" #qty [disabled]="chosenInv.invoiceStatus !== 1">
</td> </td>
</tr> </tr>
<tr class="p-0 m-0" *ngIf="inDet.poLineItemNum != -1"> <!--<tr class="p-0 m-0" *ngIf="inDet.poLineItemNum != -1">-->
<th class="align-content-center"> <!--<th class="align-content-center">-->
<p>{{getPerc(qty.value, inDet.remainingQty)}}%</p> <!--<p>{{getPerc(qty.value, inDet.remainingQty)}}%</p>-->
</th> <!--</th>-->
<td colspan="4"> <!--<td colspan="4">-->
<div class="progress" style="height: 25px;"> <!--<div class="progress" style="height: 25px;">-->
<div class="progress-bar bg-success" role="progressbar" <!--<div class="progress-bar bg-success" role="progressbar"-->
[ngStyle]="{'width': getPerc(qty.value, inDet.remainingQty) + '%'}"> <!--[ngStyle]="{'width': getPerc(qty.value, inDet.remainingQty) + '%'}">-->
{{qty.value}} <!--{{qty.value}}-->
</div> <!--</div>-->
<div class="progress-bar bg-danger" role="progressbar" <!--<div class="progress-bar bg-danger" role="progressbar"-->
[ngStyle]="{'width': (100 - getPerc(qty.value, inDet.remainingQty)) + '%'}"> <!--[ngStyle]="{'width': (100 - getPerc(qty.value, inDet.remainingQty)) + '%'}">-->
{{inDet.remainingQty - (qty.value)}} <!--{{inDet.remainingQty - (qty.value)}}-->
</div> <!--</div>-->
</div> <!--</div>-->
</td> <!--</td>-->
</tr> <!--</tr>-->
<!--<tr class="p-0 m-0">--> <!--<tr class="p-0 m-0">-->
<!--&lt;!&ndash;INV Detail Items: invoiceNum, lineItemNum, poLineItemNum, serviceTypeId, desc, qty, fee&ndash;&gt;--> <!--&lt;!&ndash;INV Detail Items: invoiceNum, lineItemNum, poLineItemNum, serviceTypeId, desc, qty, fee&ndash;&gt;-->
<!--<td class="p-0 m-0"><input type="text" class="form-control cell" [value]="inDet.lineItemNum" disabled>--> <!--<td class="p-0 m-0"><input type="text" class="form-control cell" [value]="inDet.lineItemNum" disabled>-->
@ -246,22 +249,42 @@
<!--</div>--> <!--</div>-->
<!--</td>--> <!--</td>-->
<!--</tr>--> <!--</tr>-->
<!--<tr class="p-0 m-0" *ngIf="inDet.poLineItemNum !== -1">-->
<!--<th class="align-content-center">-->
<!--<p>{{getPerc(qty.value, inDet.remainingQty)}}%</p>-->
<!--</th>-->
<!--<td colspan="5">-->
<!--<div class="progress" style="height: 25px;">-->
<!--<div class="progress-bar bg-success" role="progressbar"-->
<!--[ngStyle]="{'width': getPerc(qty.value, inDet.remainingQty) + '%'}">-->
<!--Qty - {{(qty.value)}} / Amount - {{(qty.value * inDet.fee) | currency}}-->
<!--</div>-->
<!--<div class="progress-bar bg-danger" role="progressbar"-->
<!--[ngStyle]="{'width': (100 - getPerc(qty.value, inDet.remainingQty)) + '%'}">-->
<!--Qty - {{(inDet.remainingQty - qty.value)}} / Amount - {{(inDet.remainingQty - qty.value) * inDet.fee | currency}}-->
<!--</div>-->
<!--</div>-->
<!--</td>-->
<!--</tr>-->
</tbody> </tbody>
<tbody> <tbody>
<tr> <!--<tr >-->
<td colspan="5"> <!--<td colspan="5" >-->
<select class="custom-select" <!--<p *ngIf="chosenInv.invoiceStatus == 1">-->
(change)="pushOntoSelectedDetail(inNumIn.value, newInDetails.length + 1, selectedPODetails[poDetSelec.value].lineItemNo, <!--<select class="custom-select"-->
selectedPODetails[poDetSelec.value].feeTypeId, selectedPODetails[poDetSelec.value].serviceTypeId, <!--(change)="pushOntoSelectedDetail(inNumIn.value, newInDetails.length + 1, selectedPODetails[poDetSelec.value].lineItemNo,-->
selectedPODetails[poDetSelec.value].serviceDesc, 1, 0, selectedPODetails[poDetSelec.value].remainingQty)" <!--selectedPODetails[poDetSelec.value].feeTypeId, selectedPODetails[poDetSelec.value].serviceTypeId,-->
[disabled]="!selectedPODetails.length && chosenInv.invoiceStatus !== 1" <!--selectedPODetails[poDetSelec.value].serviceDesc, 1, 0, selectedPODetails[poDetSelec.value].remainingQty)"-->
#poDetSelec> <!--[disabled]="!selectedPODetails.length && chosenInv.invoiceStatus !== 1"-->
<option>Choose PO Detail...</option> <!--#poDetSelec>-->
<option *ngFor="let po of selectedPODetails; let i = index;" [value]="i">{{po.serviceDesc}} <!--<option>Add new line item...</option>-->
</option> <!--<option *ngFor="let po of selectedPODetails; let i = index;" [value]="i">{{po.serviceDesc}}-->
</select> <!--</option>-->
</td> <!--<option [value]="-1">Out of Pocket Expenses</option>-->
</tr> <!--</select>-->
<!--</p>-->
<!--</td>-->
<!--</tr>-->
</tbody> </tbody>
</table> </table>
<table class="table table-borderless table-sm"> <table class="table table-borderless table-sm">
@ -357,13 +380,17 @@
</div> </div>
<!--Modal Footer--> <!--Modal Footer-->
<div class="modal-footer"> <div class="modal-footer" >
<p *ngIf="chosenInv.invoiceStatus == 1">
<button type="button" class="btn btn-success" <button type="button" class="btn btn-success"
(click)="editInvoice(inNumIn.value, poNumIn.value, coNumIn.value, pmtStatusIn.value, notesIn.value, certIn.value)" (click)="editInvoice(inNumIn.value, poNumIn.value, coNumIn.value, pmtStatusIn.value, notesIn.value, certIn.value)">
[disabled]="!(inNumIn.value && poNumIn.value && pmtStatusIn.value && notesIn.value && certIn.value)"> <!--[disabled]="(chosenInv.invoiceStatus !== 1)">-->
Confirm Confirm
</button> </button>
</p>
<p>
<button type="button" class="btn btn-danger" (click)="close(edit)">Cancel</button> <button type="button" class="btn btn-danger" (click)="close(edit)">Cancel</button>
</p>
</div> </div>
</app-modal-form> </app-modal-form>
@ -403,7 +430,7 @@
<tr> <tr>
<td colspan="2"> <td colspan="2">
<p *ngIf="customerSelec.value >= 0" class="p-0 m-0 mt-2"> <p *ngIf="customerSelec.value >= 0" class="p-0 m-0 mt-2">
To, {{customers[customerSelec.value].billToDept}} {{customers[customerSelec.value].billToDept}}
</p> </p>
</td> </td>
<td></td> <td></td>
@ -431,7 +458,8 @@
<tr> <tr>
<td colspan="2"> <td colspan="2">
<p *ngIf="customerSelec.value >= 0" class="p-0 m-0 mt-2"> <p *ngIf="customerSelec.value >= 0" class="p-0 m-0 mt-2">
{{customers[customerSelec.value].city}} {{customers[customerSelec.value].state}} {{customers[customerSelec.value].zip}}-{{customers[customerSelec.value].ziplast4}} {{customers[customerSelec.value].city}} {{customers[customerSelec.value].state}} {{customers[customerSelec.value].zip}}
<!-- -{{customers[customerSelec.value].ziplast4}}-->
</p> </p>
</td> </td>
<td></td> <td></td>
@ -439,9 +467,11 @@
<span class="input-group-text">Payment Status*</span> <span class="input-group-text">Payment Status*</span>
</td> </td>
<td> <td>
<select class="custom-select" #pmtStatusIn> <!--<input type="text" value="Outstanding" class="form-control" #pmtStatusIn disabled>-->
<option value=0>Not Paid</option>
<option value=1>Paid</option> <select class="custom-select" #pmtStatusIn disabled>
<option value="1">Outstanding</option>
<!--&lt;!&ndash;<option value=2>Paid</option>&ndash;&gt;-->
</select> </select>
</td> </td>
</tr> </tr>
@ -479,15 +509,15 @@
</td> </td>
<td class="p-0 m-0"><input type="text" class="form-control cell" [value]="feeTypes[inDet.feeTypeId - 1]" <td class="p-0 m-0"><input type="text" class="form-control cell" [value]="feeTypes[inDet.feeTypeId - 1]"
disabled></td> disabled></td>
<td class="p-0 m-0"><input type="text" class="form-control cell" [value]="inDet.fee | currency" #fee disabled> <td class="p-0 m-0"><input type="text" class="form-control cell" [value]="inDet.fee | currency" #fee [disabled] = "poDetails[poDetSelec.value].lineItemNo!==-1"
<!--(change)="onNewCellChange(i, 'fee', fee.value.substr(1)); updateNewBillAmt();" --> (change)="onNewCellChange(i, 'fee', fee.value.substr(1)); updateNewBillAmt();">
</td> </td>
<td class="p-0 m-0"><input type="number" class="form-control cell" [value]="inDet.qty" <td class="p-0 m-0"><input type="number" class="form-control cell" [value]="inDet.qty"
[step]="inDet.remainingQty / 100" [step]="inDet.remainingQty / 100"
(change)="onNewCellChange(i, 'qty', qty.value); updateNewBillAmt();" #qty> (change)="onNewCellChange(i, 'qty', qty.value); updateNewBillAmt();" #qty>
</td> </td>
</tr> </tr>
<tr class="p-0 m-0" *ngIf="inDet.poLineItemNum != -1"> <tr class="p-0 m-0" *ngIf="inDet.poLineItemNum !== -1">
<th class="align-content-center"> <th class="align-content-center">
<p>{{getPerc(qty.value, inDet.remainingQty)}}%</p> <p>{{getPerc(qty.value, inDet.remainingQty)}}%</p>
</th> </th>
@ -495,15 +525,20 @@
<div class="progress" style="height: 25px;"> <div class="progress" style="height: 25px;">
<div class="progress-bar bg-success" role="progressbar" <div class="progress-bar bg-success" role="progressbar"
[ngStyle]="{'width': getPerc(qty.value, inDet.remainingQty) + '%'}"> [ngStyle]="{'width': getPerc(qty.value, inDet.remainingQty) + '%'}">
{{qty.value}} Qty - {{(qty.value)}} / Amount - {{(qty.value * inDet.fee) | currency}}
</div> </div>
<div class="progress-bar bg-danger" role="progressbar" <div class="progress-bar bg-danger" role="progressbar"
[ngStyle]="{'width': (100 - getPerc(qty.value, inDet.remainingQty)) + '%'}"> [ngStyle]="{'width': (100 - getPerc(qty.value, inDet.remainingQty)) + '%'}">
{{inDet.remainingQty - (qty.value)}} Qty - {{(inDet.remainingQty - qty.value)}} / Amount - {{(inDet.remainingQty - qty.value) * inDet.fee | currency}}
</div> </div>
</div> </div>
</td> </td>
</tr> </tr>
<tr class="p-0 m-0" *ngIf="inDet.poLineItemNum == -1">
<th class="align-content-center">
<p>{{getPerc(qty.value, inDet.remainingQty)}}%</p>
</th>
</tr>
</tbody> </tbody>
<tbody> <tbody>
<tr> <tr>
@ -515,12 +550,28 @@
poNumIn.value)" poNumIn.value)"
[disabled]="!poDetails.length" [disabled]="!poDetails.length"
#poDetSelec> #poDetSelec>
<option>Choose PO Detail...</option> <option>Add line item...</option>
<option *ngFor="let po of poDetails; let i = index;" [value]="i">{{po.serviceDesc}}</option> <option *ngFor="let po of poDetails; let i = index;" [value]="i">{{po.serviceDesc}}</option>
<option [value]="-1">Out of Pocket Expenses</option> <option [value]="-1">Out of Pocket Expenses</option>
</select> </select>
</td> </td>
</tr> </tr>
<!--<tr>-->
<!--<td colspan="6">-->
<!--<select class="custom-select"-->
<!--(change)="pushOntoNewDetail(inNumIn.value, newInDetails.length + 1, poDetails[poDetSelec.value].lineItemNo,-->
<!--poDetails[poDetSelec.value].feeTypeId, poDetails[poDetSelec.value].serviceTypeId,-->
<!--poDetails[poDetSelec.value].serviceDesc, 0, poDetails[poDetSelec.value].fee, poDetails[poDetSelec.value].remainingQty,-->
<!--poNumIn.value)"-->
<!--[disabled]="!poDetails.length"-->
<!--#poDetSelec>-->
<!--<option>Add line item...</option>-->
<!--<option *ngFor="let po of poDetails; let i = index;" [value]="i">{{po.serviceDesc}}</option>-->
<!--<option [value]="-1">Out of Pocket Expenses</option>-->
<!--</select>-->
<!--</td>-->
<!--</tr>-->
</tbody> </tbody>
</table> </table>
@ -606,7 +657,7 @@
<div class="modal-footer"> <div class="modal-footer">
<button type="button" class="btn btn-success" <button type="button" class="btn btn-success"
(click)="addInvoice(inNumIn.value, poNumIn.value, coNumIn.value, pmtStatusIn.value, newBillAmt, notesIn.value, certIn.value, 1, new)" (click)="addInvoice(inNumIn.value, poNumIn.value, coNumIn.value, pmtStatusIn.value, newBillAmt, notesIn.value, certIn.value, 1, new)"
[disabled]="!(inNumIn.value && poNumIn.value && pmtStatusIn.value && newBillAmt && notesIn.value && certIn.value)"> [disabled]="!(inNumIn.value && poNumIn.value && newBillAmt && notesIn.value && certIn.value)">
Confirm Confirm
</button> </button>
<button type="reset" class="btn btn-danger" (click)="close(new)">Cancel</button> <button type="reset" class="btn btn-danger" (click)="close(new)">Cancel</button>

View File

@ -26,7 +26,7 @@ export class InvoiceComponent implements OnInit {
{headerName: 'Date', field: 'invoiceDate'}, {headerName: 'Date', field: 'invoiceDate'},
{headerName: 'Sales Order Number', field: 'poNum'}, {headerName: 'Sales Order Number', field: 'poNum'},
{headerName: 'Change Order Number', field: 'changeOrderNum'}, {headerName: 'Change Order Number', field: 'changeOrderNum'},
{headerName: 'Paid', field: 'pmtStatus'}, {headerName: 'Payment', field: 'pmtStatusDesc'},
{headerName: 'Bll Amount', field: 'billAmt'} {headerName: 'Bll Amount', field: 'billAmt'}
]; ];
newInDetails = []; newInDetails = [];
@ -455,6 +455,7 @@ export class InvoiceComponent implements OnInit {
} }
voidInvoice(invoiceNumber) { voidInvoice(invoiceNumber) {
if (confirm('Are you sure you want to void invoice, ' + invoiceNumber)) {
this.astuteClientService.voidInvoice(invoiceNumber).then((data) => { this.astuteClientService.voidInvoice(invoiceNumber).then((data) => {
if (data) { if (data) {
this.refreshData(); this.refreshData();
@ -463,6 +464,7 @@ export class InvoiceComponent implements OnInit {
} }
}); });
} }
}
submitInvoice(invoiceNumber) { submitInvoice(invoiceNumber) {
this.astuteClientService.submitInvoice(invoiceNumber).then((data) => { this.astuteClientService.submitInvoice(invoiceNumber).then((data) => {

View File

@ -161,7 +161,7 @@
<div class="modal-footer"> <div class="modal-footer">
<button class="btn btn-success" type="button" <button class="btn btn-success" type="button"
[disabled]="!(ponum.value && podate.value && customerid.value && contractnum.value && contractamt.value)" [disabled]="!(ponum.value && podate.value && customerid.value && contractnum.value && contractamt.value && projNum.value)"
(click)="addPo(projNum.value, ponum.value, podate.value, customerid.value, contractnum.value, contractamt.value.replace('$', '').replace(',', ''), title.value, new)" (click)="addPo(projNum.value, ponum.value, podate.value, customerid.value, contractnum.value, contractamt.value.replace('$', '').replace(',', ''), title.value, new)"
> >
Add Add
@ -282,8 +282,8 @@
<th scope="col">Description</th> <th scope="col">Description</th>
<th scope="col">Rate Type</th> <th scope="col">Rate Type</th>
<th scope="col">Service Type</th> <th scope="col">Service Type</th>
<th scope="col" style="width: 75px">Qty(#)</th> <th scope="col" style="width: 75px">Quantity</th>
<th scope="col" style="width: 100px">Rate($)</th> <th scope="col" style="width: 100px">Rate</th>
<!--<th scope="col">Remaining Quantity</th>--> <!--<th scope="col">Remaining Quantity</th>-->
</tr> </tr>
</thead> </thead>
@ -320,7 +320,7 @@
<!--<input type="number" class="form-control cell" [value]="poDetail.serviceTypeId" #serviceTypeId>--> <!--<input type="number" class="form-control cell" [value]="poDetail.serviceTypeId" #serviceTypeId>-->
</td> </td>
<td class="p-0 m-0"><input type="number" class="form-control cell" [value]="+poDetail.qty" (change)="onSelectedCellChange(i, 'qty', qty.value); onSelectedCellChange(i, 'remainingQty', qty.value * fee.value); updateEditContractAmt();" #qty></td> <td class="p-0 m-0"><input type="number" class="form-control cell" [value]="+poDetail.qty" (change)="onSelectedCellChange(i, 'qty', qty.value); onSelectedCellChange(i, 'remainingQty', qty.value * fee.value); updateEditContractAmt();" #qty></td>
<td class="p-0 m-0"><input type="number" class="form-control cell" [value]="+poDetail.fee" (change)="onSelectedCellChange(i, 'fee', fee.value); onSelectedCellChange(i, 'remainingQty', qty.value * fee.value); updateEditContractAmt();" #fee></td> <td class="p-0 m-0"><input type="text" class="form-control cell" [value]="+poDetail.fee | currency" (change)="onSelectedCellChange(i, 'fee', fee.value); onSelectedCellChange(i, 'remainingQty', qty.value * fee.value); updateEditContractAmt();" #fee></td>
<!--<td class="p-0 m-0"><input type="text" class="form-control cell" [value]="poDetail.remainingQty" [id]="'remainingQty' + i"></td>--> <!--<td class="p-0 m-0"><input type="text" class="form-control cell" [value]="poDetail.remainingQty" [id]="'remainingQty' + i"></td>-->
</tr> </tr>
</tbody> </tbody>
@ -357,7 +357,7 @@
<div class="modal-footer"> <div class="modal-footer">
<button class="btn btn-success" type="button" <button class="btn btn-success" type="button"
[disabled]="!(ponum.value && podate.value && contractnum.value && contractamt.value)" [disabled]="!(ponum.value && podate.value && contractnum.value && contractamt.value && projNum.value)"
(click)="editPo(projNum.value, ponum.value, podate.value, contractnum.value, contractamt.value.replace(',', '').replace('$', ''), title.value, edit)" (click)="editPo(projNum.value, ponum.value, podate.value, contractnum.value, contractamt.value.replace(',', '').replace('$', ''), title.value, edit)"
> >
Update Update

View File

@ -17,7 +17,6 @@
<output-test url="file://$MODULE_DIR$/target/test-classes" /> <output-test url="file://$MODULE_DIR$/target/test-classes" />
<content url="file://$MODULE_DIR$"> <content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
<excludeFolder url="file://$MODULE_DIR$/target" /> <excludeFolder url="file://$MODULE_DIR$/target" />
</content> </content>
<orderEntry type="inheritedJdk" /> <orderEntry type="inheritedJdk" />

View File

@ -1,6 +0,0 @@
database=sql
host=localhost
port=3306
username=root
password=password
schema=astute

View File

@ -2,7 +2,7 @@
-- Host: 127.0.0.1 -- Host: 127.0.0.1
-- Server version: 5.7.12-log - MySQL Community Server (GPL) -- Server version: 5.7.12-log - MySQL Community Server (GPL)
-- Server OS: Win64 -- Server OS: Win64
-- HeidiSQL Version: 9.4.0.5125 -- HeidiSQL Version: 9.5.0.5196
-- -------------------------------------------------------- -- --------------------------------------------------------
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
@ -49,7 +49,7 @@ DELIMITER //
CREATE DEFINER=`root`@`localhost` PROCEDURE `create_invoice`(invNo varchar(20),invDate date,PONo varchar(20),paymentStatus int,billAmt double,specialNotes varchar(500), certClause Varchar(500), invoiceStatus int) CREATE DEFINER=`root`@`localhost` PROCEDURE `create_invoice`(invNo varchar(20),invDate date,PONo varchar(20),paymentStatus int,billAmt double,specialNotes varchar(500), certClause Varchar(500), invoiceStatus int)
BEGIN BEGIN
INSERT INTO invoice (inv_no,inv_date,PO_num,pmt_status,bill_amt,special_notes,certification,inv_status) INSERT INTO invoice (inv_no,inv_date,PO_num,pmt_status,bill_amt,special_notes,certification,inv_status)
VALUES (invNo, invDate, PONo, paymentStatus, billAmt, specialNotes, certClause, invoiceStatus); VALUES (invNo, invDate, PONo, 1, billAmt, specialNotes, certClause, invoiceStatus);
END// END//
DELIMITER ; DELIMITER ;
@ -99,9 +99,10 @@ CREATE TABLE IF NOT EXISTS `customer` (
PRIMARY KEY (`customer_id`) PRIMARY KEY (`customer_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8; ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- Dumping data for table astute.customer: ~0 rows (approximately) -- Dumping data for table astute.customer: ~1 rows (approximately)
/*!40000 ALTER TABLE `customer` DISABLE KEYS */; /*!40000 ALTER TABLE `customer` DISABLE KEYS */;
INSERT INTO `customer` (`customer_id`, `customer_name`, `bill_to_dept`, `add1`, `add2`, `city`, `state`, `zip`, `zip_last_4`, `email`, `phone`, `fax`) VALUES INSERT INTO `customer` (`customer_id`, `customer_name`, `bill_to_dept`, `add1`, `add2`, `city`, `state`, `zip`, `zip_last_4`, `email`, `phone`, `fax`) VALUES
('MDOT', 'Maryland Department of Transportation', 'Billing Department', '123123 Test Drive', '104', 'Germantown', 'MD', 20874, 0, 'Test@MDOT.gov', '(123) 123-1233', '(121) 231-233'),
('VDOT', 'Virginia Depart of Transportation', 'Billing Department', '13134 Saturn Drive', 'Unit 100', 'McLean', 'VA', 22043, 0, 'Billing@vdot.gov', '(703) 122-1234', '(703) 122-1212'); ('VDOT', 'Virginia Depart of Transportation', 'Billing Department', '13134 Saturn Drive', 'Unit 100', 'McLean', 'VA', 22043, 0, 'Billing@vdot.gov', '(703) 122-1234', '(703) 122-1212');
/*!40000 ALTER TABLE `customer` ENABLE KEYS */; /*!40000 ALTER TABLE `customer` ENABLE KEYS */;
@ -180,7 +181,7 @@ INSERT INTO `fee_type` (`fee_type_id`, `fee_type_desc`) VALUES
DELIMITER // DELIMITER //
CREATE DEFINER=`root`@`localhost` FUNCTION `generate_final_inv_number`(po_num_in varchar(20)) RETURNS varchar(40) CHARSET utf8 CREATE DEFINER=`root`@`localhost` FUNCTION `generate_final_inv_number`(po_num_in varchar(20)) RETURNS varchar(40) CHARSET utf8
BEGIN BEGIN
DECLARE customer_id_in int; DECLARE customer_id_in varchar(10);
DECLARE customer_code varchar(4); DECLARE customer_code varchar(4);
DECLARE po_count int; DECLARE po_count int;
DECLARE inv_count int; DECLARE inv_count int;
@ -191,10 +192,7 @@ BEGIN
FROM po FROM po
WHERE po.po_num = po_num_in; WHERE po.po_num = po_num_in;
SELECT substr(customer.customer_id, 1, 3) SELECT substr(customer_id_in, 1, 3) INTO customer_code;
INTO customer_code
FROM customer
WHERE customer_id = customer_id_in;
SELECT po_id SELECT po_id
INTO po_count INTO po_count
@ -248,6 +246,26 @@ BEGIN
END// END//
DELIMITER ; DELIMITER ;
-- Dumping structure for function astute.get_customer_from_po
DELIMITER //
CREATE DEFINER=`root`@`localhost` FUNCTION `get_customer_from_po`(ponum varchar(20)) RETURNS varchar(20) CHARSET utf8
BEGIN
declare customer_id_out varchar(20);
SELECT customer_id INTO customer_id_out FROM po WHERE po_num = ponum;
return customer_id_out;
END//
DELIMITER ;
-- Dumping structure for function astute.get_payment_status_name
DELIMITER //
CREATE DEFINER=`root`@`localhost` FUNCTION `get_payment_status_name`(pmt_status int) RETURNS varchar(20) CHARSET utf8
BEGIN
declare payment_status_name VARCHAR(20);
SELECT payment_status_desc INTO payment_status_name FROM payment_status WHERE payment_status_id = pmt_status;
return payment_status_name;
END//
DELIMITER ;
-- Dumping structure for function astute.get_payment_type -- Dumping structure for function astute.get_payment_type
DELIMITER // DELIMITER //
CREATE DEFINER=`root`@`localhost` FUNCTION `get_payment_type`(pmt_type int) RETURNS varchar(20) CHARSET utf8 CREATE DEFINER=`root`@`localhost` FUNCTION `get_payment_type`(pmt_type int) RETURNS varchar(20) CHARSET utf8
@ -263,7 +281,7 @@ DELIMITER //
CREATE DEFINER=`root`@`localhost` FUNCTION `get_previously_billed_amt`(po_no varchar(20)) RETURNS double(10,2) CREATE DEFINER=`root`@`localhost` FUNCTION `get_previously_billed_amt`(po_no varchar(20)) RETURNS double(10,2)
BEGIN BEGIN
declare billed_amt double(10,2); declare billed_amt double(10,2);
SELECT sum(bill_amt) INTO billed_amt FROM invoice WHERE invoice.PO_num = po_no; SELECT sum(bill_amt) INTO billed_amt FROM invoice WHERE invoice.PO_num = po_no and inv_status <> 3;
return billed_amt; return billed_amt;
END// END//
DELIMITER ; DELIMITER ;
@ -283,11 +301,12 @@ CREATE TABLE IF NOT EXISTS `invoice` (
CONSTRAINT `fk_InvMaster_POnum` FOREIGN KEY (`PO_num`) REFERENCES `po` (`PO_num`) CONSTRAINT `fk_InvMaster_POnum` FOREIGN KEY (`PO_num`) REFERENCES `po` (`PO_num`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8; ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- Dumping data for table astute.invoice: ~2 rows (approximately) -- Dumping data for table astute.invoice: ~3 rows (approximately)
/*!40000 ALTER TABLE `invoice` DISABLE KEYS */; /*!40000 ALTER TABLE `invoice` DISABLE KEYS */;
INSERT INTO `invoice` (`inv_no`, `inv_date`, `PO_num`, `bill_amt`, `special_notes`, `certification`, `inv_status`, `pmt_status`) VALUES INSERT INTO `invoice` (`inv_no`, `inv_date`, `PO_num`, `bill_amt`, `special_notes`, `certification`, `inv_status`, `pmt_status`) VALUES
('VDO-01_0927_1', '2018-09-23', 'VDOT-54321', 5000, 'First invoice', 'Certified that the above items and rates are in accordance with the contractual agreement as verified by the undersigned', 2, 0), ('MDO-01_0108_1', '2019-01-08', 'MDOT-123', 30250, 'Test', 'Certified that the above items and rates are in accordance with the contractual agreement as verified by the undersigned', 3, 1),
('VDO-02_DRAFT_392', '2018-09-23', 'ABC-123', 500, 'First Invoice', 'Certified that the above items and rates are in accordance with the contractual agreement as verified by the undersigned', 1, 0); ('VDO-02_0107_2', '2019-01-07', 'ABC-123', 1450, 'Test', 'Certified that the above items and rates are in accordance with the contractual agreement as verified by the undersigned', 3, 1),
('VDO-02_0108_3', '2019-01-08', 'ABC-123', 5250, 'Test', 'Certified that the above items and rates are in accordance with the contractual agreement as verified by the undersigned', 2, 1);
/*!40000 ALTER TABLE `invoice` ENABLE KEYS */; /*!40000 ALTER TABLE `invoice` ENABLE KEYS */;
-- Dumping structure for table astute.invoice_detail -- Dumping structure for table astute.invoice_detail
@ -306,13 +325,19 @@ CREATE TABLE IF NOT EXISTS `invoice_detail` (
CONSTRAINT `fk_InvDetail_InvNum` FOREIGN KEY (`inv_num`) REFERENCES `invoice` (`inv_no`) ON DELETE CASCADE ON UPDATE CASCADE CONSTRAINT `fk_InvDetail_InvNum` FOREIGN KEY (`inv_num`) REFERENCES `invoice` (`inv_no`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8; ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- Dumping data for table astute.invoice_detail: ~4 rows (approximately) -- Dumping data for table astute.invoice_detail: ~10 rows (approximately)
/*!40000 ALTER TABLE `invoice_detail` DISABLE KEYS */; /*!40000 ALTER TABLE `invoice_detail` DISABLE KEYS */;
INSERT INTO `invoice_detail` (`inv_num`, `line_item_num`, `PO_line_item_num`, `service_type_id`, `description`, `qty`, `fee`, `fee_type_id`) VALUES INSERT INTO `invoice_detail` (`inv_num`, `line_item_num`, `PO_line_item_num`, `service_type_id`, `description`, `qty`, `fee`, `fee_type_id`) VALUES
('VDO-01_0927_1', 1, 1, 1, 'Study existing designs', 0, 1000, 1), ('MDO-01_0108_1', 1, 1, 2, 'Design', 0.5, 2500, 1),
('VDO-01_0927_1', 2, 4, 3, 'Peer Review', 50, 100, 2), ('MDO-01_0108_1', 2, 2, 1, 'Study', 5, 100, 2),
('VDO-02_DRAFT_392', 1, 1, 2, 'Design', 0, 5000, 1), ('MDO-01_0108_1', 3, 3, 3, 'Peer Review', 50, 250, 2),
('VDO-02_DRAFT_392', 2, -1, 1, 'Out of Pocket Expenses', 50, 10, 1); ('MDO-01_0108_1', 4, 4, 4, 'Cost Estimation', 50, 250, 2),
('MDO-01_0108_1', 5, 5, 5, 'Forensic Investigation', 0.5, 5000, 1),
('MDO-01_0108_1', 6, -1, 1, 'Out of Pocket Expenses - gas', 50, 20, 1),
('VDO-02_0107_2', 1, 1, 2, 'Design', 0.25, 5000, 1),
('VDO-02_0107_2', 2, -1, 1, 'Out of Pocket Expenses', 20, 10, 1),
('VDO-02_0108_3', 1, 1, 2, 'Design', 0.25, 5000, 1),
('VDO-02_0108_3', 2, 3, 1, 'Study', 200, 20, 1);
/*!40000 ALTER TABLE `invoice_detail` ENABLE KEYS */; /*!40000 ALTER TABLE `invoice_detail` ENABLE KEYS */;
-- Dumping structure for table astute.invoice_notes -- Dumping structure for table astute.invoice_notes
@ -334,23 +359,20 @@ CREATE TABLE IF NOT EXISTS `invoice_payment` (
`invoice_amount` double NOT NULL, `invoice_amount` double NOT NULL,
`payment_date` date NOT NULL, `payment_date` date NOT NULL,
`invoice_payment_id` int(11) NOT NULL AUTO_INCREMENT, `invoice_payment_id` int(11) NOT NULL AUTO_INCREMENT,
`description` varchar(50) DEFAULT NULL, `check_transaction_no` varchar(50) NOT NULL,
`void_payment_status` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`invoice_payment_id`), PRIMARY KEY (`invoice_payment_id`),
KEY `fk_inv_pmt_inv_no` (`inv_no`), KEY `fk_inv_pmt_inv_no` (`inv_no`),
KEY `fk_pinv_pmt_type` (`invoice_payment_type`), KEY `fk_pinv_pmt_type` (`invoice_payment_type`),
CONSTRAINT `fk_inv_pmt_inv_no` FOREIGN KEY (`inv_no`) REFERENCES `invoice` (`inv_no`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `fk_inv_pmt_inv_no` FOREIGN KEY (`inv_no`) REFERENCES `invoice` (`inv_no`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `fk_pinv_pmt_type` FOREIGN KEY (`invoice_payment_type`) REFERENCES `payment_type` (`payment_type_id`) CONSTRAINT `fk_pinv_pmt_type` FOREIGN KEY (`invoice_payment_type`) REFERENCES `payment_type` (`payment_type_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8; ) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8;
-- Dumping data for table astute.invoice_payment: ~6 rows (approximately) -- Dumping data for table astute.invoice_payment: ~1 rows (approximately)
/*!40000 ALTER TABLE `invoice_payment` DISABLE KEYS */; /*!40000 ALTER TABLE `invoice_payment` DISABLE KEYS */;
INSERT INTO `invoice_payment` (`inv_no`, `invoice_payment_type`, `invoice_amount`, `payment_date`, `invoice_payment_id`, `description`) VALUES INSERT INTO `invoice_payment` (`inv_no`, `invoice_payment_type`, `invoice_amount`, `payment_date`, `invoice_payment_id`, `check_transaction_no`, `void_payment_status`) VALUES
('VDO-01_0927_1', 2, 900, '2018-09-29', 1, 'VDO-01_0927_1 FIrst Payment'), ('VDO-02_0107_2', 2, 5000, '2019-01-09', 13, '123456', 0),
('VDO-01_0927_1', 2, 980, '2018-09-27', 2, NULL), ('VDO-02_0107_2', 2, 5000, '2019-01-08', 15, '123123', 0);
('VDO-01_0927_1', 2, 1000, '2018-09-27', 3, NULL),
('VDO-01_0927_1', 2, 1000, '2018-09-27', 4, NULL),
('VDO-01_0927_1', 2, 1000, '2018-09-27', 5, NULL),
('VDO-01_0927_1', 2, 200, '2018-09-28', 12, NULL);
/*!40000 ALTER TABLE `invoice_payment` ENABLE KEYS */; /*!40000 ALTER TABLE `invoice_payment` ENABLE KEYS */;
-- Dumping structure for table astute.invoice_status -- Dumping structure for table astute.invoice_status
@ -390,12 +412,13 @@ CREATE TABLE IF NOT EXISTS `payment_type` (
PRIMARY KEY (`payment_type_id`) PRIMARY KEY (`payment_type_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8; ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- Dumping data for table astute.payment_type: ~3 rows (approximately) -- Dumping data for table astute.payment_type: ~4 rows (approximately)
/*!40000 ALTER TABLE `payment_type` DISABLE KEYS */; /*!40000 ALTER TABLE `payment_type` DISABLE KEYS */;
INSERT INTO `payment_type` (`payment_type_id`, `payment_type_name`) VALUES INSERT INTO `payment_type` (`payment_type_id`, `payment_type_name`) VALUES
(1, 'Credit Card'), (1, 'Credit Card'),
(2, 'Check'), (2, 'Check'),
(3, 'ACH'); (3, 'ACH'),
(4, 'Wire Transfer');
/*!40000 ALTER TABLE `payment_type` ENABLE KEYS */; /*!40000 ALTER TABLE `payment_type` ENABLE KEYS */;
-- Dumping structure for table astute.po -- Dumping structure for table astute.po
@ -416,10 +439,11 @@ CREATE TABLE IF NOT EXISTS `po` (
CONSTRAINT `po_customer_id_fk` FOREIGN KEY (`customer_id`) REFERENCES `customer` (`customer_id`) CONSTRAINT `po_customer_id_fk` FOREIGN KEY (`customer_id`) REFERENCES `customer` (`customer_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8; ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- Dumping data for table astute.po: ~2 rows (approximately) -- Dumping data for table astute.po: ~3 rows (approximately)
/*!40000 ALTER TABLE `po` DISABLE KEYS */; /*!40000 ALTER TABLE `po` DISABLE KEYS */;
INSERT INTO `po` (`PO_num`, `contract_num`, `PO_date`, `contract_amt`, `customer_id`, `astute_project_num`, `po_id`, `title`, `inv_seq`) VALUES INSERT INTO `po` (`PO_num`, `contract_num`, `PO_date`, `contract_amt`, `customer_id`, `astute_project_num`, `po_id`, `title`, `inv_seq`) VALUES
('ABC-123', 'ABC-123', '2018-09-23', 5000.00, 'VDOT', 'ABC-123', 2, 'ABC-123', 0), ('ABC-123', 'ABC-123', '2018-09-23', 27000.00, 'VDOT', 'ABC-123', 2, 'ABC-123', 3),
('MDOT-123', 'MDOT-123 ContractNo', '2019-01-08', 58500.00, 'MDOT', 'MDOT-123 ProjNo', 1, 'MDOT-123 SO Title', 1),
('VDOT-54321', 'VDOT-54321', '2018-09-22', 10000.00, 'VDOT', 'VDOTProj', 1, 'Supervisor', 1); ('VDOT-54321', 'VDOT-54321', '2018-09-22', 10000.00, 'VDOT', 'VDOTProj', 1, 'Supervisor', 1);
/*!40000 ALTER TABLE `po` ENABLE KEYS */; /*!40000 ALTER TABLE `po` ENABLE KEYS */;
@ -439,14 +463,21 @@ 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: ~5 rows (approximately) -- Dumping data for table astute.po_detail: ~12 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
('ABC-123', 1, 'Design', 1, 1, 2, 5000, 1), ('ABC-123', 1, 'Design', 1, 1, 2, 5000, 0.75),
('ABC-123', 2, 'Out of Expense', 1, 100, 6, 20, 100),
('ABC-123', 3, 'Study', 1, 1000, 1, 20, 800),
('MDOT-123', 1, 'Design', 1, 1, 2, 2500, 1),
('MDOT-123', 2, 'Study', 2, 10, 1, 100, 10),
('MDOT-123', 3, 'Peer Review', 2, 100, 3, 250, 100),
('MDOT-123', 4, 'Cost Estimation', 2, 100, 4, 250, 100),
('MDOT-123', 5, 'Forensic Investigation', 1, 1, 5, 5000, 1),
('VDOT-54321', 1, 'Study existing designs', 1, 1, 1, 1000, 1), ('VDOT-54321', 1, 'Study existing designs', 1, 1, 1, 1000, 1),
('VDOT-54321', 2, 'Modify design', 1, 1, 2, 2000, 1), ('VDOT-54321', 2, 'Modify design', 1, 1, 2, 2000, 1),
('VDOT-54321', 3, 'Cost estimation', 1, 1, 4, 1000, 1), ('VDOT-54321', 3, 'Cost estimation', 1, 1, 4, 1000, 1),
('VDOT-54321', 4, 'Peer Review', 2, 100, 3, 100, 50); ('VDOT-54321', 4, 'Peer Review', 2, 100, 3, 100, 100);
/*!40000 ALTER TABLE `po_detail` ENABLE KEYS */; /*!40000 ALTER TABLE `po_detail` ENABLE KEYS */;
-- Dumping structure for table astute.service_type -- Dumping structure for table astute.service_type
@ -456,7 +487,7 @@ CREATE TABLE IF NOT EXISTS `service_type` (
PRIMARY KEY (`service_type_id`) PRIMARY KEY (`service_type_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8; ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- Dumping data for table astute.service_type: ~5 rows (approximately) -- Dumping data for table astute.service_type: ~6 rows (approximately)
/*!40000 ALTER TABLE `service_type` DISABLE KEYS */; /*!40000 ALTER TABLE `service_type` DISABLE KEYS */;
INSERT INTO `service_type` (`service_type_id`, `desc`) VALUES INSERT INTO `service_type` (`service_type_id`, `desc`) VALUES
(1, 'Study'), (1, 'Study'),
@ -478,18 +509,24 @@ CREATE TABLE IF NOT EXISTS `session` (
CONSTRAINT `fk_session_user_id` FOREIGN KEY (`user_id`) REFERENCES `user` (`user_id`) CONSTRAINT `fk_session_user_id` FOREIGN KEY (`user_id`) REFERENCES `user` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8; ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- Dumping data for table astute.session: ~10 rows (approximately) -- Dumping data for table astute.session: ~16 rows (approximately)
/*!40000 ALTER TABLE `session` DISABLE KEYS */; /*!40000 ALTER TABLE `session` DISABLE KEYS */;
INSERT INTO `session` (`session_id`, `user_id`, `session_start_date`, `session_end_date`) VALUES INSERT INTO `session` (`session_id`, `user_id`, `session_start_date`, `session_end_date`) VALUES
('042ef08346f84d52b98a22dab48c7b1c', 1, NULL, NULL),
('058cdb87447645da9ec265e566af834c', 1, NULL, NULL), ('058cdb87447645da9ec265e566af834c', 1, NULL, NULL),
('46d91a474f4544a2ab60002f799383a7', 1, NULL, NULL),
('4f48b60481ab4729a26b809c077fc7c0', 1, NULL, NULL), ('4f48b60481ab4729a26b809c077fc7c0', 1, NULL, NULL),
('5df808bb502044ccb6e9da1bce0c63d4', 2, NULL, NULL),
('66ed2bccbaf34b1e96b2b81393996cf9', 1, NULL, NULL), ('66ed2bccbaf34b1e96b2b81393996cf9', 1, NULL, NULL),
('8f8991185a174b87adb7d0b1b40c1475', 1, NULL, NULL), ('8f8991185a174b87adb7d0b1b40c1475', 1, NULL, NULL),
('92cd1d01085c4ead892a1c7c137631dd', 1, NULL, NULL), ('92cd1d01085c4ead892a1c7c137631dd', 1, NULL, NULL),
('9c0a7444f67f4de5a789014413445458', 1, NULL, NULL),
('abeefc05fe8e48e5bac7ffab65c85ca6', 1, NULL, NULL), ('abeefc05fe8e48e5bac7ffab65c85ca6', 1, NULL, NULL),
('b356aab1dbe84d4f9eea9c1cd965c9a4', 1, NULL, NULL), ('b356aab1dbe84d4f9eea9c1cd965c9a4', 1, NULL, NULL),
('d6387d93d84341fc91a0c4a5cbf266db', 1, NULL, NULL), ('d6387d93d84341fc91a0c4a5cbf266db', 1, NULL, NULL),
('d98f7e0c9a934afaa89f0f0545c1c81c', 1, NULL, NULL),
('dcb4b261f925464bb69ff685c1c6134d', 1, NULL, NULL), ('dcb4b261f925464bb69ff685c1c6134d', 1, NULL, NULL),
('f6546dbfa5454a339f2093b2ac1f3b54', 1, NULL, NULL),
('fea623a6ff3148899214750707f4f52e', 1, NULL, NULL); ('fea623a6ff3148899214750707f4f52e', 1, NULL, NULL);
/*!40000 ALTER TABLE `session` ENABLE KEYS */; /*!40000 ALTER TABLE `session` ENABLE KEYS */;

View File

@ -46,13 +46,7 @@ public abstract class DAO {
* @throws AstuteException * @throws AstuteException
*/ */
public static void init() throws AstuteException { public static void init() throws AstuteException {
try { // try {
File configDir = new File(System.getProperty("catalina.base"), "conf");
File configFile = new File(configDir, "db.config");
InputStream stream = new FileInputStream(configFile);
Properties props = new Properties();
props.load(stream);
// Properties props = new Properties(); // Properties props = new Properties();
// InputStream input = new FileInputStream("db.config"); // InputStream input = new FileInputStream("db.config");
@ -60,12 +54,18 @@ public abstract class DAO {
// props.load(input); // props.load(input);
//get properties //get properties
database = props.getProperty("database"); // database = props.getProperty("database");
host = props.getProperty("host"); // host = props.getProperty("host");
port = Integer.parseInt(props.getProperty("port")); // port = Integer.parseInt(props.getProperty("port"));
schema = props.getProperty("schema"); // schema = props.getProperty("schema");
username = props.getProperty("username"); // username = props.getProperty("username");
password = props.getProperty("password"); // password = props.getProperty("password");
database = "sql";
host = "localhost";
port = 3306;
schema = "astute";
username = "root";
password = "password";
System.out.println("============================================="); System.out.println("=============================================");
System.out.println("host is " + host); System.out.println("host is " + host);
System.out.println("port is " + port); System.out.println("port is " + port);
@ -74,9 +74,9 @@ public abstract class DAO {
System.out.println("password is " + password); System.out.println("password is " + password);
System.out.println("============================================="); System.out.println("=============================================");
dao = new SqlDAO(); dao = new SqlDAO();
} catch (IOException e) { // } catch (IOException e) {
e.printStackTrace(); // e.printStackTrace();
} // }
} }
public Connection conn; public Connection conn;
@ -166,9 +166,9 @@ public abstract class DAO {
public abstract List<InvoicePayment> getInvoicePayments(String invoiceNum) throws AstuteException; public abstract List<InvoicePayment> getInvoicePayments(String invoiceNum) throws AstuteException;
public abstract void updateInvoicePayment(String invoiceNum, int invoicePaymentId, Double paymentAmount, Date paymentDate) throws AstuteException; public abstract void updateInvoicePayment(String invoiceNum, int invoicePaymentId, int InvoicePaymentTypeId, Double paymentAmount, Date paymentDate, String checkTransactionNo) throws AstuteException;
public abstract void createInvoicePayment(String invoiceNum, int invoicePaymentTypeId, Double paymentAmount, Date paymentDate) throws AstuteException; public abstract void createInvoicePayment(String invoiceNum, int invoicePaymentTypeId, Double paymentAmount, Date paymentDate, String checkTransactionNo) throws AstuteException;
public abstract List<PaymentType> getPaymentTypes() throws AstuteException; public abstract List<PaymentType> getPaymentTypes() throws AstuteException;
} }

View File

@ -339,7 +339,7 @@ public class SqlDAO extends DAO {
Statement stmt = conn.createStatement(); Statement stmt = conn.createStatement();
String whereClause = " WHERE "; String whereClause = " WHERE ";
boolean whereClauseIndicator = false; boolean whereClauseIndicator = false;
String sql = "SELECT inv_no, inv_date, PO_num, pmt_status, bill_amt, special_notes, certification, inv_status FROM INVOICE "; String sql = "SELECT inv_no, inv_date, PO_num, pmt_status, bill_amt, special_notes, certification, inv_status, get_payment_status_name(pmt_status), get_customer_from_po(PO_num) FROM INVOICE ";
if (invoiceNumber != null && !invoiceNumber.isEmpty()) { if (invoiceNumber != null && !invoiceNumber.isEmpty()) {
whereClause = whereClause + " UPPER(inv_no) = '"+ invoiceNumber.toUpperCase() +"'"; whereClause = whereClause + " UPPER(inv_no) = '"+ invoiceNumber.toUpperCase() +"'";
whereClauseIndicator = true; whereClauseIndicator = true;
@ -365,8 +365,9 @@ public class SqlDAO extends DAO {
String specialNotes = rs.getString(6); String specialNotes = rs.getString(6);
String certification = rs.getString(7); String certification = rs.getString(7);
int invoiceStatus = rs.getInt(8); int invoiceStatus = rs.getInt(8);
String paymentStatusDesc = rs.getString(9);
Invoice invoice = new Invoice(invNo, invdDate, PONo, paymentStatus, billAmt, specialNotes, certification, invoiceStatus); String customerId = rs.getString(10);
Invoice invoice = new Invoice(invNo, invdDate, PONo, paymentStatus, billAmt, specialNotes, certification, invoiceStatus, paymentStatusDesc, customerId);
invoices.add(invoice); invoices.add(invoice);
} }
return invoices; return invoices;
@ -428,7 +429,6 @@ public class SqlDAO extends DAO {
} }
updateClause = updateClause + " inv_date = STR_TO_DATE('" + invoiceDate + "', '%Y-%m-%d')" + ","; updateClause = updateClause + " inv_date = STR_TO_DATE('" + invoiceDate + "', '%Y-%m-%d')" + ",";
updateClause = updateClause + " PO_num = '" + PONum + "',"; updateClause = updateClause + " PO_num = '" + PONum + "',";
updateClause = updateClause + " pmt_status = " + pmtStatus + ",";
updateClause = updateClause + " bill_amt = " + billAmt + ","; updateClause = updateClause + " bill_amt = " + billAmt + ",";
updateClause = updateClause + " special_notes = '" + specialNotes + "',"; updateClause = updateClause + " special_notes = '" + specialNotes + "',";
updateClause = updateClause + " certification = '" + certification + "',"; updateClause = updateClause + " certification = '" + certification + "',";
@ -630,7 +630,7 @@ public class SqlDAO extends DAO {
while (resultSet.next()) { while (resultSet.next()) {
invoiceNumber = resultSet.getString(1); invoiceNumber = resultSet.getString(1);
invoice = new Invoice(invoiceNumber,null,null,0,null,null,null,0); invoice = new Invoice(invoiceNumber,null,null,1,null,null,null,0, "Outstanding","");
invoices.add(invoice); invoices.add(invoice);
} }
} catch (SQLException e) { } catch (SQLException e) {
@ -920,7 +920,7 @@ public class SqlDAO extends DAO {
try { try {
List<InvoicePayment> invoicePayments = new ArrayList<InvoicePayment>(); List<InvoicePayment> invoicePayments = new ArrayList<InvoicePayment>();
Statement stmt = conn.createStatement(); Statement stmt = conn.createStatement();
String sql = "SELECT invoice_payment_id, invoice_payment_type, get_payment_type(invoice_payment_type), invoice_amount, payment_date, inv_no FROM invoice_payment "; String sql = "SELECT invoice_payment_id, invoice_payment_type, get_payment_type(invoice_payment_type), invoice_amount, payment_date, inv_no, check_transaction_no FROM invoice_payment ";
if (invoiceNum != null) { if (invoiceNum != null) {
sql += " WHERE inv_no = '" + invoiceNum + "'"; sql += " WHERE inv_no = '" + invoiceNum + "'";
} }
@ -932,7 +932,8 @@ public class SqlDAO extends DAO {
Double paymentAmount = rs.getDouble(4); Double paymentAmount = rs.getDouble(4);
Date paymentDate = rs.getDate(5); Date paymentDate = rs.getDate(5);
String invNo = rs.getString(6); String invNo = rs.getString(6);
InvoicePayment invoicePayment = new InvoicePayment(invNo, invoicePaymentId, invoicePaymentTypeId, invoicePaymentType, paymentDate, paymentAmount); String checkTransactionNo = rs.getString(7);
InvoicePayment invoicePayment = new InvoicePayment(invNo, invoicePaymentId, invoicePaymentTypeId, invoicePaymentType, paymentDate, paymentAmount, checkTransactionNo);
invoicePayments.add(invoicePayment); invoicePayments.add(invoicePayment);
} }
return invoicePayments; return invoicePayments;
@ -942,7 +943,7 @@ public class SqlDAO extends DAO {
} }
}; };
public void updateInvoicePayment(String invoiceNum, int invoicePaymentId, Double paymentAmount, Date paymentDate) throws AstuteException { public void updateInvoicePayment(String invoiceNum, int invoicePaymentId, int invoicePaymentTypeId, Double paymentAmount, Date paymentDate, String checkTransactionNo) throws AstuteException {
try { try {
String sql = "UPDATE INVOICE_PAYMENT "; String sql = "UPDATE INVOICE_PAYMENT ";
String updateClause = " SET "; String updateClause = " SET ";
@ -952,7 +953,7 @@ public class SqlDAO extends DAO {
} }
updateClause = updateClause + " invoice_amount = " + paymentAmount ; updateClause = updateClause + " invoice_payment_type = " + invoicePaymentTypeId + ", invoice_amount = " + paymentAmount + ", check_Transaction_No = '" + checkTransactionNo + "'";
// if (paymentDate != null) { // if (paymentDate != null) {
updateClause = updateClause + ", payment_date = STR_TO_DATE('" + paymentDate + "', '%Y-%m-%d')"; updateClause = updateClause + ", payment_date = STR_TO_DATE('" + paymentDate + "', '%Y-%m-%d')";
// } // }
@ -969,10 +970,10 @@ public class SqlDAO extends DAO {
} }
public void createInvoicePayment(String invoiceNum, int invoicePaymentTypeId, Double paymentAmount, Date paymentDate) throws AstuteException{ public void createInvoicePayment(String invoiceNum, int invoicePaymentTypeId, Double paymentAmount, Date paymentDate, String checkTransactionNo) throws AstuteException{
try { try {
String dateString = "STR_TO_DATE('" + paymentDate + "', '%Y-%m-%d')"; String dateString = "STR_TO_DATE('" + paymentDate + "', '%Y-%m-%d')";
String sql = "insert into invoice_payment (inv_no, invoice_payment_type, invoice_amount, payment_date) values ('" + invoiceNum + "', " + invoicePaymentTypeId + ", " + paymentAmount + ", " + dateString + ")"; String sql = "insert into invoice_payment (inv_no, invoice_payment_type, invoice_amount, payment_date, check_transaction_no) values ('" + invoiceNum + "', " + invoicePaymentTypeId + ", " + paymentAmount + ", " + dateString + ", " + checkTransactionNo +")";
Statement stmt = conn.createStatement(); Statement stmt = conn.createStatement();
System.out.println(sql); System.out.println(sql);
stmt.execute(sql); stmt.execute(sql);

View File

@ -1,19 +1,19 @@
package com.astute.model; package com.astute.model;
import java.util.Date;
public class Invoice { public class Invoice {
String invoiceNumber; String invoiceNumber;
String invoiceDate; String invoiceDate;
String poNum; String poNum;
String changeOrderNum; String changeOrderNum;
String pmtStatusDesc;
int pmtStatus; int pmtStatus;
Double billAmt; Double billAmt;
String specialNotes; String specialNotes;
String certification; String certification;
int invoiceStatus; int invoiceStatus;
String customerId;
public Invoice(String invoiceNumber, String invoiceDate, String poNum, int pmtStatus, Double billAmt, String specialNotes, String certification, int invoiceStatus) { public Invoice(String invoiceNumber, String invoiceDate, String poNum, int pmtStatus, Double billAmt, String specialNotes, String certification, int invoiceStatus, String pmtStatusDesc, String customerId) {
this.invoiceNumber = invoiceNumber; this.invoiceNumber = invoiceNumber;
this.invoiceDate = invoiceDate; this.invoiceDate = invoiceDate;
this.poNum = poNum; this.poNum = poNum;
@ -22,6 +22,8 @@ public class Invoice {
this.specialNotes = specialNotes; this.specialNotes = specialNotes;
this.certification = certification; this.certification = certification;
this.invoiceStatus = invoiceStatus; this.invoiceStatus = invoiceStatus;
this.pmtStatusDesc = pmtStatusDesc;
this.customerId = customerId;
} }
public String getInvoiceNumber() { public String getInvoiceNumber() {
@ -57,6 +59,14 @@ public class Invoice {
this.changeOrderNum = changeOrderNum; this.changeOrderNum = changeOrderNum;
} }
public String getPmtStatusDesc() {
return pmtStatusDesc;
}
public void setPmtStatusDesc(String pmtStatusDesc) {
this.pmtStatusDesc = pmtStatusDesc;
}
public int getPmtStatus() { public int getPmtStatus() {
return pmtStatus; return pmtStatus;
} }
@ -96,4 +106,12 @@ public class Invoice {
public void setInvoiceStatus(int invoiceStatus) { public void setInvoiceStatus(int invoiceStatus) {
this.invoiceStatus = invoiceStatus; this.invoiceStatus = invoiceStatus;
} }
public String getCustomerId() {
return customerId;
}
public void setCustomerId(String customerId) {
this.customerId = customerId;
}
} }

View File

@ -9,14 +9,15 @@ public class InvoicePayment {
String paymentType; String paymentType;
Date paymentDate; Date paymentDate;
Double invoiceAmount; Double invoiceAmount;
String checkTransactionNo;
public InvoicePayment(String invoiceNum, int invoicePaymentId, int paymentTypeId, String paymentType, Date paymentDate, Double invoiceAmount) { public InvoicePayment(String invoiceNum, int invoicePaymentId, int paymentTypeId, String paymentType, Date paymentDate, Double invoiceAmount, String checkTransactionNo) {
this.invoiceNum = invoiceNum; this.invoiceNum = invoiceNum;
this.invoicePaymentId = invoicePaymentId; this.invoicePaymentId = invoicePaymentId;
this.paymentTypeId = paymentTypeId; this.paymentTypeId = paymentTypeId;
this.paymentType = paymentType; this.paymentType = paymentType;
this.paymentDate = paymentDate; this.paymentDate = paymentDate;
this.invoiceAmount = invoiceAmount; this.invoiceAmount = invoiceAmount;
this.checkTransactionNo = checkTransactionNo;
} }
public String getInvoiceNum() { public String getInvoiceNum() {
@ -66,4 +67,12 @@ public class InvoicePayment {
public void setInvoiceAmount(Double invoiceAmount) { public void setInvoiceAmount(Double invoiceAmount) {
this.invoiceAmount = invoiceAmount; this.invoiceAmount = invoiceAmount;
} }
public String getCheckTransactionNo() {
return checkTransactionNo;
}
public void setCheckTransactionNo(String checkTransactionNo) {
this.checkTransactionNo = checkTransactionNo;
}
} }

View File

@ -8,14 +8,16 @@ public class InvoicePaymentRequest {
String paymentType; String paymentType;
String paymentDate; String paymentDate;
Double invoiceAmount; Double invoiceAmount;
String checkTransactionNo;
public InvoicePaymentRequest(String invoiceNum, int invoicePaymentId, int paymentTypeId, String paymentType, String paymentDate, Double invoiceAmount) { public InvoicePaymentRequest(String invoiceNum, int invoicePaymentId, int paymentTypeId, String paymentType, String paymentDate, Double invoiceAmount, String checkTransactionNo) {
this.invoiceNum = invoiceNum; this.invoiceNum = invoiceNum;
this.invoicePaymentId = invoicePaymentId; this.invoicePaymentId = invoicePaymentId;
this.paymentTypeId = paymentTypeId; this.paymentTypeId = paymentTypeId;
this.paymentType = paymentType; this.paymentType = paymentType;
this.paymentDate = paymentDate; this.paymentDate = paymentDate;
this.invoiceAmount = invoiceAmount; this.invoiceAmount = invoiceAmount;
this.checkTransactionNo = checkTransactionNo;
} }
public InvoicePaymentRequest() { public InvoicePaymentRequest() {
@ -69,4 +71,12 @@ public class InvoicePaymentRequest {
public void setInvoiceAmount(Double invoiceAmount) { public void setInvoiceAmount(Double invoiceAmount) {
this.invoiceAmount = invoiceAmount; this.invoiceAmount = invoiceAmount;
} }
public String getCheckTransactionNo() {
return checkTransactionNo;
}
public void setCheckTransactionNo(String checkTransactionNo) {
this.checkTransactionNo = checkTransactionNo;
}
} }

View File

@ -30,13 +30,13 @@ public class InvoicePaymentResource {
@Path("/{invoiceNum}/{invoicePaymentId}") @Path("/{invoiceNum}/{invoicePaymentId}")
@PUT @PUT
public Response updateInvoicePayment(InvoicePaymentRequest request, @PathParam("invoiceNum") String invoiceNum, @PathParam("invoicePaymentId") int invoicePaymentId) public Response updateInvoicePayment(InvoicePaymentRequest request, @PathParam("invoiceNum") String invoiceNum, @PathParam("invoicePaymentId") int invoicePaymentId, @PathParam("checkTransactionNo")String checkTransactionNo)
throws AstuteException, ParseException { throws AstuteException, ParseException {
String dateStr = request.getPaymentDate(); String dateStr = request.getPaymentDate();
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd"); SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
Date date = new java.sql.Date(df.parse(dateStr).getTime()); Date date = new java.sql.Date(df.parse(dateStr).getTime());
service.updateInvoicePayment(invoiceNum,invoicePaymentId, request.getInvoiceAmount(), date); service.updateInvoicePayment(invoiceNum,invoicePaymentId, request.getPaymentTypeId(), request.getInvoiceAmount(), date, request.getCheckTransactionNo());
return new ApiResponse(ApiResponse.UPDATE_ACCESS_SUCESS).toResponse(); return new ApiResponse(ApiResponse.UPDATE_ACCESS_SUCESS).toResponse();
} }
@ -46,7 +46,7 @@ public class InvoicePaymentResource {
String dateStr = request.getPaymentDate(); String dateStr = request.getPaymentDate();
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd"); SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
Date date = new java.sql.Date(df.parse(dateStr).getTime()); Date date = new java.sql.Date(df.parse(dateStr).getTime());
service.createInvoicePayment(request.getInvoiceNum(), request.getPaymentTypeId(), request.getInvoiceAmount(),date); service.createInvoicePayment(request.getInvoiceNum(), request.getPaymentTypeId(), request.getInvoiceAmount(),date,request.getCheckTransactionNo());
return new ApiResponse(ApiResponse.UPDATE_ACCESS_SUCESS).toResponse(); return new ApiResponse(ApiResponse.UPDATE_ACCESS_SUCESS).toResponse();
} }

View File

@ -19,15 +19,15 @@ public class InvoicePaymentService extends Service{
return getDao().getInvoicePayments(invoiceNum); return getDao().getInvoicePayments(invoiceNum);
} }
public void updateInvoicePayment(String invoiceNum, int invoicePaymentId, Double paymentAmount, Date paymentDate) public void updateInvoicePayment(String invoiceNum, int invoicePaymentId, int InvoicePaymentTypeId, Double paymentAmount, Date paymentDate, String checkTransactionNo)
throws AstuteException { throws AstuteException {
getDao().updateInvoicePayment(invoiceNum, invoicePaymentId, paymentAmount, paymentDate); getDao().updateInvoicePayment(invoiceNum, invoicePaymentId, InvoicePaymentTypeId, paymentAmount, paymentDate, checkTransactionNo);
} }
public void createInvoicePayment(String invoiceNum, int invoicePaymentTypeId, Double paymentAmount, Date paymentDate) public void createInvoicePayment(String invoiceNum, int invoicePaymentTypeId, Double paymentAmount, Date paymentDate, String checkTransactionNo)
throws AstuteException { throws AstuteException {
getDao().createInvoicePayment(invoiceNum, invoicePaymentTypeId, paymentAmount, paymentDate); getDao().createInvoicePayment(invoiceNum, invoicePaymentTypeId, paymentAmount, paymentDate, checkTransactionNo);
} }
public List<PaymentType> getPaymentTypes() throws AstuteException { public List<PaymentType> getPaymentTypes() throws AstuteException {