Skip to content

Commit b1127f1

Browse files
committed
done task 138
1 parent edfad42 commit b1127f1

4 files changed

Lines changed: 15 additions & 5 deletions

File tree

src/AccountGoWeb/Scripts/Sales/SalesOrder.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ class EditButton extends React.Component<any, {}> {
328328
render() {
329329
return (
330330
<a href="#" id="linkEdit" onClick={this.onClickEditButton}
331-
className={!store.editMode
331+
className={!store.editMode && !store.hasQuotation
332332
//className={store.salesOrder.statusId == 0 && !store.editMode
333333
? "btn"
334334
: "btn inactiveLink"}>

src/AccountGoWeb/Scripts/Shared/Stores/Sales/SalesOrderStore.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export default class SalesOrderStore {
2020
@observable salesOrderStatus;
2121
@observable salesQuotationStatus;
2222
@observable editMode = false;
23+
@observable hasQuotation = false;
2324
constructor(quotationId, orderId) {
2425
this.commonStore = new CommonStore();
2526
this.salesOrder = new SalesOrder();
@@ -42,7 +43,7 @@ export default class SalesOrderStore {
4243
this.salesOrder.referenceNo = result.data.referenceNo;
4344
this.changedOrderDate(result.data.quotationDate);
4445
this.getQuotationStatus(result.data.statusId);
45-
46+
this.hasQuotation = true; // this variable will serve as the footprint that it has a quotation and the edit button wil be disable.
4647
//for addition to save quotation to set status closed - order created
4748
this.salesOrder.quotationId = quotationId;
4849
for (var i = 0; i < result.data.salesQuotationLines.length; i++) {

src/AccountGoWeb/Views/Quotations/Quotations.cshtml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,16 @@
4646
document.getElementById('linkViewQuotation').setAttribute('href', 'quotation?id=' + selectedRow.id);
4747
document.getElementById('linkViewQuotation').setAttribute('class', 'btn');
4848
49-
document.getElementById('linkNewOrder').setAttribute('href', '/sales/salesorder?quotationId=' + selectedRow.id);
50-
document.getElementById('linkNewOrder').setAttribute('class', 'btn');
49+
50+
console.log(selectedRow);
51+
if (selectedRow.statusId == 1) {
52+
document.getElementById('linkNewOrder').setAttribute('href', '/sales/salesorder?quotationId=' + selectedRow.id);
53+
document.getElementById('linkNewOrder').setAttribute('class', 'btn');
54+
}
55+
else //if (selectedRow.status == 3)
56+
{
57+
document.getElementById('linkNewOrder').setAttribute('class', 'btn inactiveLink');
58+
}
5159
}
5260
5361
// wait for the document to be loaded, otherwise

src/Api/Controllers/SalesController.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,8 @@ public IActionResult Quotations()
369369
PaymentTermId = quote.PaymentTermId,
370370
QuotationDate = quote.Date,
371371
ReferenceNo = quote.ReferenceNo,
372-
SalesQuoteStatus = quote.Status.ToString()
372+
SalesQuoteStatus = quote.Status.ToString(),
373+
StatusId = (int)quote.Status
373374
};
374375

375376
foreach (var line in quote.SalesQuoteLines)

0 commit comments

Comments
 (0)