dump add selling

This commit is contained in:
Kayn Ty 2018-04-06 16:39:41 +02:00
parent 3642e128f9
commit 0d750d6b7c
4 changed files with 61 additions and 11 deletions

View File

@ -31,12 +31,26 @@
</li>
</ul>
<div class="text-right">
<h3>Total: <strong>{{ CurrentSellingTotal() }}€</strong></h3>
<input type="number" id="paid_amount" ng-model="paidAmount">
<div class="alert alert-success" ng-if="CurrentSellingTotal() - paidAmount <=0">
<h3>Rendu: {{ CurrentSellingTotal() - paidAmount }}€</h3>
<div class="row">
<div class="col-xs-6">
<h3>Total: </h3>
</div>
<div class="alert alert-warning" ng-if="CurrentSellingTotal() - paidAmount >0">
<div class="col-xs-6">
<strong>{{ CurrentSellingTotal() }}€</strong>
</div>
</div>
<div class="row">
<div class="col-xs-6">
Le client paie:
</div>
<div class="col-xs-6">
<input type="number" id="paid_amount" ng-model="paidAmount">
</div>
</div>
<div class="alert alert-success" ng-if="paidAmount && CurrentSellingTotal() - paidAmount <=0">
<h3>Rendu: {{ -1*(CurrentSellingTotal() - paidAmount) }} €</h3>
</div>
<div class="alert alert-warning" ng-if="paidAmount && CurrentSellingTotal() - paidAmount >0">
<h3>il manque: {{ CurrentSellingTotal() - paidAmount }} €</h3>
</div>
</div>

View File

@ -68,18 +68,23 @@ angular
$scope.pausedSelling.splice(index, 1);
};
$scope.clearCurrentSelling = function () {
$scope.paidAmount = 0;
$scope.commentaire = "";
$scope.activeSelling = [];
};
$scope.sendForm = function () {
let lesParams = {
paidByClient : $scope.paidAmount,
sellingComment: $scope.commentaire,
activeSelling : $scope.activeSelling,
activeFestival: $scope.activeFestival
};
$http({
method : 'POST',
url : '/add-selling',
url : 'add-selling',
headers: {
'Content-Type': 'application/json'
},
data : lesParams // pass in data as strings
}).then(function (rep) {
console.log(rep);

View File

@ -124,6 +124,18 @@ class DefaultController extends Controller {
// setup dates
// persist all
// fetch back history of selling
return new JsonResponse( [ "message" => "ok", "dump" => $request->request ] );
echo "<pre>";
var_dump( $_POST );
echo "</pre>";
return var_dump( $request->request );
// return new JsonResponse( [
// "message" => "ok",
// "recent_sellings" => [],
// "dump" => $request->request->get( 'sellingComment' ),
// "dump2" => $request->getMethod(),
// "dump3" => $request->request->get( 'data' ),
// ] );
}
}

View File

@ -32,9 +32,14 @@ class SellRecord {
/**
* total
* @ORM\Column(type="decimal", scale=2, nullable=true)
* @ORM\Column(type="decimal", scale=2, nullable=false)
*/
private $amount;
/**
* amount paid by client
* @ORM\Column(type="decimal", scale=2, nullable=true)
*/
private $paidByClient;
/**
* @var
@ -49,6 +54,20 @@ class SellRecord {
private $user;
/**
* @return mixed
*/
public function getPaidByClient() {
return $this->paidByClient;
}
/**
* @param mixed $paidByClient
*/
public function setPaidByClient( $paidByClient ) {
$this->paidByClient = $paidByClient;
}
/**
* @return mixed
*/