Commit f9e31bca by yasir

update

1 parent d4217b53
...@@ -45,7 +45,9 @@ def query_csv(request, status): ...@@ -45,7 +45,9 @@ def query_csv(request, status):
')' ')'
]).label('Nama_Customer'), ]).label('Nama_Customer'),
vendor.nama.label('Nama_Vendor'), vendor.nama.label('Nama_Vendor'),
PartnerPay.amt_sell.label('Harga'), PartnerPay.amt_buy.label('Harga_Beli'),
PartnerPay.amt_sell.label('Harga_Jual'),
PartnerPay.fee.label('Fee'),
case( case(
[ [
(PartnerPay.status <= 0, 0) (PartnerPay.status <= 0, 0)
...@@ -103,7 +105,8 @@ class ViewData(BaseView): ...@@ -103,7 +105,8 @@ class ViewData(BaseView):
dict(title = "Tanggal"), dict(title = "Tanggal"),
dict(title="Customer"), dict(title="Customer"),
dict(title="Vendor"), dict(title="Vendor"),
dict(title="Amount"), dict(title="Harga Beli"),
dict(title="Harga Jual"),
dict(title="Fee"), dict(title="Fee"),
dict(title="Status"), dict(title="Status"),
], ],
...@@ -113,9 +116,10 @@ class ViewData(BaseView): ...@@ -113,9 +116,10 @@ class ViewData(BaseView):
dict(data = "created"), dict(data = "created"),
dict(data="customer"), dict(data="customer"),
dict(data="vendor"), dict(data="vendor"),
dict(data="amount", width="100px"), dict(data="amount_buy", width="70px"),
dict(data="fee", width="100px"), dict(data="amount", width="70px"),
dict(data="status", width="100px"), dict(data="fee", width="70px"),
dict(data="status", width="70px"),
], ],
'buttons': [ 'buttons': [
dict(id="btn_view", cls="btn btn btn-primary", title="View"), dict(id="btn_view", cls="btn btn btn-primary", title="View"),
...@@ -174,7 +178,7 @@ class ViewData(BaseView): ...@@ -174,7 +178,7 @@ class ViewData(BaseView):
mData='customer' mData='customer'
), ),
ColumnDT(vendor.nama, mData='vendor'), ColumnDT(vendor.nama, mData='vendor'),
ColumnDT(PartnerPay.amt_buy, mData='amount_buy'),
ColumnDT(PartnerPay.amt_sell, mData='amount'), ColumnDT(PartnerPay.amt_sell, mData='amount'),
ColumnDT(PartnerPay.fee, mData='fee'), ColumnDT(PartnerPay.fee, mData='fee'),
ColumnDT(case( ColumnDT(case(
...@@ -209,7 +213,9 @@ class ViewData(BaseView): ...@@ -209,7 +213,9 @@ class ViewData(BaseView):
'Tanggal', 'Tanggal',
'Nama_Customer', 'Nama_Customer',
'Nama_Vendor', 'Nama_Vendor',
'Harga', 'Harga_Beli',
'Harga_Jual',
'Fee',
'Status' 'Status'
] ]
else: else:
......
...@@ -41,10 +41,12 @@ def query_csv(request, status): ...@@ -41,10 +41,12 @@ def query_csv(request, status):
customer = aliased(Partner, name='customer') customer = aliased(Partner, name='customer')
query = DBSession.query(H2hArInvoice.cust_inv_no.label('Nomor_Invoice'), query = DBSession.query(H2hArInvoice.cust_inv_no.label('Nomor_Invoice'),
H2hArInvoice.created.label('Tanggal'), H2hArInvoice.created.label('Tanggal'),
H2hArInvoiceDet.id_pel.label('ID.Pel'),
customer.nama.label('Nama_Customer'), customer.nama.label('Nama_Customer'),
vendor.nama.label('Nama_Vendor'), vendor.nama.label('Nama_Vendor'),
Produk.nama.label('Nama_Produk'), Produk.nama.label('Nama_Produk'),
H2hArInvoiceDet.amt_sell.label('Harga'), H2hArInvoiceDet.amt_buy.label('Harga_Beli'),
H2hArInvoiceDet.amt_sell.label('Harga_Jual'),
case( case(
[ [
(H2hArInvoiceDet.status <= 0, 0) (H2hArInvoiceDet.status <= 0, 0)
...@@ -115,7 +117,8 @@ class ViewData(BaseView): ...@@ -115,7 +117,8 @@ class ViewData(BaseView):
dict(title="Customer"), dict(title="Customer"),
dict(title="Vendor"), dict(title="Vendor"),
dict(title="Produk"), dict(title="Produk"),
dict(title="Harga"), dict(title="Harga Beli"),
dict(title="Harga Jual"),
dict(title="Status"), dict(title="Status"),
], ],
'column_data': [ 'column_data': [
...@@ -126,6 +129,7 @@ class ViewData(BaseView): ...@@ -126,6 +129,7 @@ class ViewData(BaseView):
dict(data="customer"), dict(data="customer"),
dict(data="vendor"), dict(data="vendor"),
dict(data="produk"), dict(data="produk"),
dict(data="harga_beli", width="100px"),
dict(data="harga", width="100px"), dict(data="harga", width="100px"),
dict(data="status", width="100px"), dict(data="status", width="100px"),
], ],
...@@ -171,6 +175,7 @@ class ViewData(BaseView): ...@@ -171,6 +175,7 @@ class ViewData(BaseView):
ColumnDT(customer.nama, mData='customer'), ColumnDT(customer.nama, mData='customer'),
ColumnDT(vendor.nama, mData='vendor'), ColumnDT(vendor.nama, mData='vendor'),
ColumnDT(Produk.nama, mData='produk'), ColumnDT(Produk.nama, mData='produk'),
ColumnDT(H2hArInvoiceDet.amt_buy, mData='harga_beli'),
ColumnDT(H2hArInvoiceDet.amt_sell, mData='harga'), ColumnDT(H2hArInvoiceDet.amt_sell, mData='harga'),
ColumnDT(case( ColumnDT(case(
[ [
...@@ -205,9 +210,11 @@ class ViewData(BaseView): ...@@ -205,9 +210,11 @@ class ViewData(BaseView):
header = [ header = [
'Nomor_Invoice', 'Nomor_Invoice',
'Tanggal', 'Tanggal',
'ID.Pel',
'Nama_Customer', 'Nama_Customer',
'Nama_Produk', 'Nama_Produk',
'Harga', 'Harga_Beli',
'Harga_Jual',
'Status' 'Status'
] ]
else: else:
......
...@@ -116,11 +116,12 @@ ...@@ -116,11 +116,12 @@
{'data': 'id', 'width': '0px'}, {'data': 'id', 'width': '0px'},
{'data': 'nomor', 'width': '150px'}, {'data': 'nomor', 'width': '150px'},
{'data': 'tanggal', 'width': '85px'}, {'data': 'tanggal', 'width': '85px'},
{'data': 'customer'}, {'data': 'customer', 'width': '80px'},
{'data': 'vendor'}, {'data': 'vendor', 'width': '80px'},
{'data': 'amount', 'width': '100px'}, {'data': 'amount_buy', 'width': '70px'},
{'data': 'fee', 'width': '100px'}, {'data': 'amount', 'width': '70px'},
{'data': 'status', 'width': '100px', {'data': 'fee', 'width': '70px'},
{'data': 'status', 'width': '70px',
'render': function(data, type, full, meta) { 'render': function(data, type, full, meta) {
var st = ${params.status_payment}; var st = ${params.status_payment};
return st[data]; return st[data];
......
...@@ -115,13 +115,14 @@ ...@@ -115,13 +115,14 @@
columns: [ columns: [
{'data': 'id', 'width': '0px'}, {'data': 'id', 'width': '0px'},
{'data': 'nomor', 'width': '150px'}, {'data': 'nomor', 'width': '150px'},
{'data': 'tanggal', 'width': '85px'}, {'data': 'tanggal', 'width': '60px'},
{'data': 'id_pel', 'width': '150px'}, {'data': 'id_pel', 'width': '150px'},
{'data': 'customer'}, {'data': 'customer', 'width': '80px'},
{'data': 'vendor'}, {'data': 'vendor', 'width': '80px'},
{'data': 'produk'}, {'data': 'produk', 'width': '150px'},
{'data': 'harga', 'width': '100px'}, {'data': 'harga_beli', 'width': '70px'},
{'data': 'status', 'width': '100px', {'data': 'harga', 'width': '70px'},
{'data': 'status', 'width': '70px',
'render': function(data, type, full, meta) { 'render': function(data, type, full, meta) {
var st = ${params.status_purchase}; var st = ${params.status_purchase};
return st[data]; return st[data];
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!