shareneus 1.5.20 → 1.5.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -479,7 +479,7 @@ export declare class ReceiptPDFService {
479
479
  }[];
480
480
  })[];
481
481
  };
482
- static GetTowards(Ids: any, IsRepairOrder: boolean): {
482
+ static GetTowards(Ids: any, IsRepairOrder: boolean, Sts: any, RemAmt: any): {
483
483
  columns: {
484
484
  stack: ({
485
485
  text: ({
@@ -25,7 +25,7 @@ class ReceiptPDFService {
25
25
  this.GetPayment(ReceiptData.PaymentId, isHC),
26
26
  this.GetName(ReceiptData.FullName),
27
27
  this.GetRupee(ReceiptData.TotalAmount),
28
- this.GetTowards(ReceiptData.Ids, ReceiptData.RepairOrder),
28
+ this.GetTowards(ReceiptData.Ids, ReceiptData.RepairOrder, ReceiptData.Sts, ReceiptData.RemAmt),
29
29
  this.GetAmount(ReceiptData.PaymentType, ReceiptData.TypeNumber, ReceiptData.PaidDate),
30
30
  // this.GetDrawDate(ReceiptData.PaymentType,ReceiptData.PaidDate),
31
31
  this.GetCompanyName(ReceiptData.Entity.CName),
@@ -180,7 +180,7 @@ class ReceiptPDFService {
180
180
  ]
181
181
  };
182
182
  }
183
- static GetTowards(Ids, IsRepairOrder) {
183
+ static GetTowards(Ids, IsRepairOrder, Sts, RemAmt) {
184
184
  let data = '';
185
185
  let toward = '';
186
186
  for (let i = 0; i < Ids.length; i++) {
@@ -197,6 +197,9 @@ class ReceiptPDFService {
197
197
  }
198
198
  else {
199
199
  toward = 'INVOICE - ' + data;
200
+ if (RemAmt > 0) {
201
+ toward += ' (remaining Rs.' + RemAmt + ' as advance)';
202
+ }
200
203
  }
201
204
  }
202
205
  else {
@@ -24,6 +24,7 @@ class ReceiptPrintService {
24
24
  ReceiptData.TypeNumber = '';
25
25
  }
26
26
  ReceiptData.TotalAmount = PaymentViewData.Amt;
27
+ ReceiptData.RemAmt = PaymentViewData.RemAmt;
27
28
  ReceiptData.PaidDate = my_date_1.MyDate.ConvertUTCDateToReadable(PaymentViewData.Date);
28
29
  ReceiptData.Ids = this.GetRecordIds(PaymentViewData);
29
30
  ReceiptData.Type = 'Receipt';
@@ -35,11 +36,11 @@ class ReceiptPrintService {
35
36
  static GetRecordIds(PaymentViewData) {
36
37
  let IdList = [];
37
38
  var i = 0;
38
- if (!tr_utils_1.TrUtils.IsNull(PaymentViewData.Invs) && PaymentViewData.Invs.length !== 0) {
39
- for (i = 0; i < PaymentViewData.Invs.length; i++) {
40
- let Id = PaymentViewData.Invs[i].Code;
41
- if (!tr_utils_1.TrUtils.IsNull(PaymentViewData.Invs[i].RegNo)) {
42
- Id = Id + '(' + PaymentViewData.Invs[i].RegNo + ')';
39
+ if (!tr_utils_1.TrUtils.IsNull(PaymentViewData.AllocRefs) && PaymentViewData.AllocRefs.length !== 0) {
40
+ for (i = 0; i < PaymentViewData.AllocRefs.length; i++) {
41
+ let Id = PaymentViewData.AllocRefs[i].Code;
42
+ if (!tr_utils_1.TrUtils.IsNull(PaymentViewData.AllocRefs[i].RegNo)) {
43
+ Id = Id + '(' + PaymentViewData.AllocRefs[i].RegNo + ')';
43
44
  }
44
45
  IdList.push(Id);
45
46
  }
@@ -160,6 +160,7 @@ function SalesTotalCalculations(items = [], ops = [], isTaxable = false, taxCode
160
160
  returnSubtotal,
161
161
  returnTax,
162
162
  returnTotal,
163
+ returnTotalDiscount,
163
164
  nonReturnSubTotal,
164
165
  nonReturnTax,
165
166
  nonReturnTotal,
@@ -205,10 +206,12 @@ function SalesTotalCalculationsWithDecimals(items = [], ops = [], isTaxable = fa
205
206
  subtotalOnLabor: roundToDecimals(result.subtotalOnLabor),
206
207
  totalDiscountOnItems: roundToDecimals(result.totalDiscountOnItems),
207
208
  totalDiscountOnLabor: roundToDecimals(result.totalDiscountOnLabor),
209
+ // returned related fields
208
210
  netAmountAfterDiscount: roundToDecimals(result.netAmountAfterDiscount),
209
211
  returnSubtotal: roundToDecimals(result.returnSubtotal),
210
212
  returnTax: roundToDecimals(result.returnTax),
211
213
  returnTotal: roundToDecimals(result.returnTotal),
214
+ returnTotalDiscount: roundToDecimals(result.returnTotalDiscount),
212
215
  nonReturnSubTotal: roundToDecimals(result.nonReturnSubTotal),
213
216
  nonReturnTax: roundToDecimals(result.nonReturnTax),
214
217
  nonReturnTotal: roundToDecimals(result.nonReturnTotal),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shareneus",
3
- "version": "1.5.20",
3
+ "version": "1.5.22",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",